If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
heh, I like it.. though yea, most likey a hoax since you can't really calculate a human body going down a slip and slide that accurately. small shift in body position = big change in friction. (Not to mention all the tiny lumps in the ground)
Play Brutal Nature, Black Moons free to play highly realistic voxel sandbox game.
More importantly the velocity required to make the distance shown is far higher than could be attained even with zero friction over that drop at that angle. Acceleration is equal to the cosine of the angle of the slope times 10 metres per second per second. Then subtract the velocity lost climbing the ramp.
Free software for calculating bolt circles and similar: Click Here
On the subject of trusting calculations, should you trust your computer?
Here is a very simple BASIC program:
For k = 0 to 1 step .001
next k
print k
It counts from zero to one in increments of .001. Once it reaches 1 (or more) it then stops and prints the value of the counter, in this instance the variable "k".
The values zero, one and .001 are all rational numbers so no roundoff errors should be expected. However, the result produced is 1.000991 and the number of times the loop executes is 1001, not 1000.
This happens in every version of basic I have ever encountered and is independent of the operating system or the platform used. It is an inherent error in how a computer deals with numbers.
Can anyone explain why?
Free software for calculating bolt circles and similar: Click Here
On the subject of trusting calculations, should you trust your computer?
Here is a very simple BASIC program:
For k = 0 to 1 step .001
next k
print k
It counts from zero to one in increments of .001. Once it reaches 1 (or more) it then stops and prints the value of the counter, in this instance the variable "k".
The values zero, one and .001 are all rational numbers so no roundoff errors should be expected. However, the result produced is 1.000991 and the number of times the loop executes is 1001, not 1000.
This happens in every version of basic I have ever encountered and is independent of the operating system or the platform used. It is an inherent error in how a computer deals with numbers.
Can anyone explain why?
because you can't precisely represent .001 with a binary floating point number.
That's correct. Specifically, it can only be represented in binary as an endless repeating number in the same way that 1/3 = .33333333... in decimal.
The binary value for D0.001 is 1.000001100010010011011101001011110001101010011111 10111110011101101100100010110100001110010101100000 01000001100010010011011101001b*10b^-1010b
When you change number bases you change also what numbers can be exactly represented. This can lead to all sorts of problems if you aren't aware of it, especially if you are doing your own math instead of relying on a coprocessor.
Free software for calculating bolt circles and similar: Click Here
Re: Evan's program error. It's not the fact that it is "floating point" that is the source of the error. If you built a floating point processor that operated in decimal numbers, and yes it could be done, then it would work OK as long as you had a decimal precision to at least three decimal places built into it.
The actual error comes about, as Evan says, due to the fact that all computers work with binary and the number 0.001 can not be expressed without using an infinite decimal. Because the computer's numbers can not be infinitely long, there is a rounding error at each iteration through the loop and it winds up a bit short after 1000 iterations. Thus, it needs one more or 1001 times to finally end the loop.
The easy way to avoid the problem is to change it to
For n = 1 to 1000 Step 1
If you don't specify the use of interer math, this will use the same floating point numbers, but it avoids the rounding error because binary numbers can represent the number 1 exactly, without any rounding error (1 decimal = 1 binary, exactly).
Also,
For n = 1 to 125 Step 0.125
should also work as binary numbers can represent 0.125 exactly, without using an infinite decimal (0.125 decimal = 0.001 binary, exactly). So there is no rounding error.
It's not the floating point math, it is the binary math that is the "problem".
Paul A.
SE Texas
Make it fit.
You can't win and there IS a penalty for trying!
As do all of the IBM 360 - 390 series processors (Packed Format is a compressed signed BCD form). They are used precisely because of the inaccuracy of binary representation.
BCD has always been representable on Intel x86 hardware, but most if not all compiler and interpreter vendors don't use it because there were few native mathematical operations supported on the chip. Thus, everything had to be done in software and at 4.77 mhz, that was too slow.
Floats are usually represented internally in the exponent mantissa form of (I believe) IEEE-754 which states 80 bits total to hold the value. There are other forms (short floats - 64 bits, long floats - 128 bits) but they still suffer from the limitations of the representation.
Comment