#### Do you have a question? Post it now! No Registration Necessary. Now with pictures!

## Re: how do I get more numbers past the decimal?

<snip>

And if his machine had stored 50 decimal places, he would have gotten

yet different results.

It doesn't matter what language you are using - you will NEVER get exact

results for a random number in any language. That's what random is all

about. You will also never get exact results for some math operations,

like (1/3) * 3 will never equal 1. It doesn't matter what language you

use - it's a fact of digital life.

What you need to do is determine how much accuracy you really need.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

## Re: how do I get more numbers past the decimal?

Question: is Chaos Theory the theory of roundoff errors? In other

words, if you do the math EXACTLY (e.g. using algebra, not reducing

everything to numbers immediately, so at least the errors cannot

cascade. Hint: this will be time-consuming.), do all the wierd

things described still happen?

## Re: how do I get more numbers past the decimal?

You can't do the maths exactly. The equations cannot be solved, which is

what would be required.

E.g., for a universe consisting of two bodies (which orbit one another,

say), you

***can***solve the equations, which means you can calculate

exactly where they both will be in a billyun years time.

However, add just

***one***extra body, and you cannot solve the equations,

so you can

***only***calculate the answer numerically. This means that

since you cannot know

***exactly***where the three bodies are to start

with, you are inherently unable to calculate where they will be far in

the future.

For the Solar System, it's possible to calculate that a billyun years

into the future and show that the planets' orbits are broadly speaking

stable. But enough error creeps in so that you don't know where on the

orbit they are.

This is why space vehicles need mid-course corrections and why you can't

say with any certainty whether asteroid xyz123 will hit the Earth in 30

years time.

--

Tim

"That excessive bail ought not to be required, nor excessive fines imposed,

nor cruel and unusual punishments inflicted" -- Bill of Rights 1689

## Re: how do I get more numbers past the decimal?

Tim Streater wrote:

That's one class of systems, its not the only class that falls under the

new fangled term 'chaotic'

There probably is a correct term for that set: deterministic, computable

but not by simple maths. I.e. only calculable by 'brute force' methods.

That's one class of systems, its not the only class that falls under the

new fangled term 'chaotic'

There probably is a correct term for that set: deterministic, computable

but not by simple maths. I.e. only calculable by 'brute force' methods.

## Re: how do I get more numbers past the decimal?

wrote:

Good lord, what is your definition of the phrase "new fangled"? Chaos

theory begins to take shape with Lorenz's work in the early 1960s,

but it finally acquired a name in 1975 when James Yorke published his

paper "Period 3 implies chaos". (His paper showed that any nonlinear

equation that developed a period of 3 would also, given certain

parameters, produce chaotic results with no period at all.) And I'm

reading James Gleick's book, which was on the New York Times best-

seller list for a long time in the 80s/90s, and which was published in

1987. Not what I would refer to as "new fangled".

Good lord, what is your definition of the phrase "new fangled"? Chaos

theory begins to take shape with Lorenz's work in the early 1960s,

but it finally acquired a name in 1975 when James Yorke published his

paper "Period 3 implies chaos". (His paper showed that any nonlinear

equation that developed a period of 3 would also, given certain

parameters, produce chaotic results with no period at all.) And I'm

reading James Gleick's book, which was on the New York Times best-

seller list for a long time in the 80s/90s, and which was published in

1987. Not what I would refer to as "new fangled".

## Re: how do I get more numbers past the decimal?

Well old fangled is pythagoras,

Normal is Newtonian calculus ;-)

The reason I say new fangled is because its not actually new, and never

was. Equations with extreme sensitivity were known for many years, as

was the three body problem. Then this idiot stumbles on it and thinks

he has discovered something new..

Same with the 'Gaia theory' or whatever its called.

The only 'new' bit was that computers made exploring these equations

with numerical analysis possible.

And along came Mandelbrot...

## Re: how do I get more numbers past the decimal?

Tim Streater wrote:

Actually, that's not why spacecraft need mid-course corrections. Short

term (within a few thousand years) calculations are very accurate.

Spacecraft need corrections because angles and propulsion, while good,

are not perfect. And even a very minor deviation from the desired

course or a minor difference in calculated vs. actual propulsion effects

add up over time.

Not to mention other, unknown variables such as effects of the solar

wind over long distances.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

Actually, that's not why spacecraft need mid-course corrections. Short

term (within a few thousand years) calculations are very accurate.

Spacecraft need corrections because angles and propulsion, while good,

are not perfect. And even a very minor deviation from the desired

course or a minor difference in calculated vs. actual propulsion effects

add up over time.

Not to mention other, unknown variables such as effects of the solar

wind over long distances.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

## Re: how do I get more numbers past the decimal?

Yes, that's a better exposition than mine. Related is the fact that we

don't know, and can't measure with sufficient accuracy, the initial

conditions.

--

Tim

"That excessive bail ought not to be required, nor excessive fines imposed,

nor cruel and unusual punishments inflicted" -- Bill of Rights 1689

## Re: how do I get more numbers past the decimal?

Gordon Burditt wrote:

No.

Yes.

Chaos theory is about the incredibly complex solutions possible from

very simple equations.

Even if they are exact solutions.

And its also about sensitivity.

The bullet that misses by a hairsbreadth and doesn't kill you, and the

one that gets a slight gust and does..

Its also about the mathematics of edges, because edges are binary things

in an analogue world.

If you like the simplest example of a chaotic system is balancing a

pencil on its point, and working out which way it will fall.

Never mind the maths, you know it depends on the draught that sets it in

motion, or the precision with which you can balance it.

If a set of equations has a widely varying solution depending on small

variations in its terms, you know its a very unstable description.

Plenty of life features things like that. Just not for long..:-)

No.

Yes.

Chaos theory is about the incredibly complex solutions possible from

very simple equations.

Even if they are exact solutions.

And its also about sensitivity.

The bullet that misses by a hairsbreadth and doesn't kill you, and the

one that gets a slight gust and does..

Its also about the mathematics of edges, because edges are binary things

in an analogue world.

If you like the simplest example of a chaotic system is balancing a

pencil on its point, and working out which way it will fall.

Never mind the maths, you know it depends on the draught that sets it in

motion, or the precision with which you can balance it.

If a set of equations has a widely varying solution depending on small

variations in its terms, you know its a very unstable description.

Plenty of life features things like that. Just not for long..:-)

## Re: how do I get more numbers past the decimal?

Jake Barnes wrote:

For very high precision, programmers use binary coded decimal (BCD).

It's slower - but can be as accurate as you want. That's what they use

to calculate pi to multi-billion decimal places, for instance (of

course, they don't use a PC for it! :-) ).

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

For very high precision, programmers use binary coded decimal (BCD).

It's slower - but can be as accurate as you want. That's what they use

to calculate pi to multi-billion decimal places, for instance (of

course, they don't use a PC for it! :-) ).

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

## Re: how do I get more numbers past the decimal?

This page makes it seem like there are several variations on BCD:

http://en.wikipedia.org/wiki/Binary-coded_decimal

I'm curious which of these variations is considered high precision?

I'm confused by this bit, which sounds like it lacks precision:

"BCD is very common in electronic systems where a numeric value is to

be displayed, especially in systems consisting solely of digital

logic, and not containing a microprocessor. By utilizing BCD, the

manipulation of numerical data for display can be greatly simplified

by treating each digit as a separate single sub-circuit. This matches

much more closely the physical reality of display hardware=97a designer

might choose to use a series of separate identical 7-segment displays

to build a metering circuit, for example. If the numeric quantity were

stored and manipulated as pure binary, interfacing to such a display

would require complex circuitry. Therefore, in cases where the

calculations are relatively simple working throughout with BCD can

lead to a simpler overall system than converting to binary.

The same argument applies when hardware of this type uses an embedded

microcontroller or other small processor. Often, smaller code results

when representing numbers internally in BCD format, since a conversion

from or to binary representation can be expensive on such limited

processors. For these applications, some small processors feature BCD

arithmetic modes, which assist when writing routines that manipulate

BCD quantities."

## Re: how do I get more numbers past the decimal?

Jake Barnes wrote:

You could say that - some hardware will support bcd natively, some

won't. For instance, IBM mainframes have special operations just for

BCD arithmetic. It supports up to 255 digits. Intel chips also support

bcd natively, but only up to 7 or 8 digits.

However, there are also software implementations which effectively have

no length limit (other than available storage); digits are typically

stored in a string and operations performed on the string. As you can

imagine, this will be much slower - but accuracy can be very high.

Yes, you'll need a math group. What precision you will want will depend

a lot on the algorithms you're using.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

You could say that - some hardware will support bcd natively, some

won't. For instance, IBM mainframes have special operations just for

BCD arithmetic. It supports up to 255 digits. Intel chips also support

bcd natively, but only up to 7 or 8 digits.

However, there are also software implementations which effectively have

no length limit (other than available storage); digits are typically

stored in a string and operations performed on the string. As you can

imagine, this will be much slower - but accuracy can be very high.

Yes, you'll need a math group. What precision you will want will depend

a lot on the algorithms you're using.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

## Re: how do I get more numbers past the decimal?

Jake Barnes wrote:

Dont worry. Jerry was talking out of his arse. BCD is no more and no=20

less accurate on generic numbers than anything else., its virtue is its=20

exact reproduction of decimal numbers like 12.3456.

Fair comment really.

With BCD you generally use one byte per significant digit, so its as=20

precise on the mantissa as the number of bytes allocated.

## Re: how do I get more numbers past the decimal?

The Natural Philosopher wrote:

Which once again shows you're stupidity. ROFLMAO!

Processors use one nibble per digit (two digits per byte). But if you

really were an engineer like you claim, you'd know that. Or, if you

ever coded in assembler, you'd know that.

The idiot has been caught (again)!

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

## Re: how do I get more numbers past the decimal?

The Natural Philosopher wrote:

Can't read, either, can you? I never complained it was

***completely***

precise. I claimed it was

***more***precise.

And it has nothing to do with your memory. It has everything to do with

you being caught in another lie.

--

==================

Remove the "x" from my email address

Jerry Stuckle

JDS Computer Training Corp.

jstucklex@attglobal.net

==================

#### Site Timeline

- » Create an image - thumbnail on the fly
- — Next thread in » PHP Scripting Forum

- » super substr()?
- — Previous thread in » PHP Scripting Forum

- » URL redirection
- — Newest thread in » PHP Scripting Forum

- » Seamless SSO
- — Last Updated thread in » PHP Scripting Forum

- » Dell Battery Slice LED codes
- — The site's Newest Thread. Posted in » Laptop Computers Forum