Browse Search Popular Register Upload Rules User list Login:
Search:
ISSUES WITH FLOATS

Image:
screenshot of the scene

Author: GoAnimateCPUAlgodoo

Group: Default

Filesize: 67.98 kB

Date added: 2017-04-26

Rating: 5

Downloads: 373

Views: 277

Comments: 15

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

When 2^exponent is then 2^exponent+1 then the gap will get much larger. Causing rounding issues.
Floats do NOT overflow. Beyond 3.4282*10^38 then it will be +inf or -inf.
Please log in to rate this scene
edit
Similar scenes
Title: Do not USE what floats say to you!
Rating: 5
Filesize: 67.44 kB
Downloads: 495
Comments: 31
Ratings: 1
Date added: 2017/08/08 21:00:01
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Phun Flight Simulator 1.2 (floats version)
Rating: 5.25
Filesize: 113.77 kB
Downloads: 1096
Comments: 7
Ratings: 2
Date added: 2010/02/18 19:42:09
Made with: Phun
Rating: rated 5.3
download
Title: What floats in the air
Rating: 5
Filesize: 8.1 kB
Downloads: 180
Comments: 0
Ratings: 1
Date added: 2014/08/13 10:57:34
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: big baloon
Rating: 5
Filesize: 40.78 kB
Downloads: 326
Comments: 0
Ratings: 1
Date added: 2016/05/01 23:22:46
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: kid floats with 50 ballons
Rating: 5
Filesize: 93.36 kB
Downloads: 814
Comments: 0
Ratings: 1
Date added: 2022/07/31 21:14:42
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: The block that floats!
Rating: 5
Filesize: 3.6 kB
Downloads: 448
Comments: 0
Ratings: 1
Date added: 2021/07/27 22:58:06
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Yeah, we've known that there are some undesirable and sometimes peculiar results from the Algodoo floating point calculations. But those results are actually expected! I have seen similar issues in countless other products that calculate floats, and the reason has to do with rounding errors caused by limited precision. The beauty of floating point (FP) is that it gives us a very large dynamic range of input and output values. But because of the limited precision, there are rounding errors that creep into each calculation that will cause results that are not quite perfect. For example, when you add 2 + 2, you might get as an answer: 4.000000012 (or something like that).

There are things we can do that either ignore the errors by masking them off in the answer, or you can implement an extra rounding calculation. And if you can get by with using only integers in your calculations, then you won't have to deal with many of the issues that come along with FP calculations (but of course you would not have the wide range of values that FP calculations offer).
Thanks for the advice. But the algodoo world (saves) are also FP. This means at X coordinate of 8388608 or sort of number. It will shake because of rendering issues with FP calculations. But I discovered at Y coordinate of 67108864, the clouds will dissapear. (simply not rendering)
I also even tried passing the 32-bit integer limit (2,147,483,648) at the X coordinate. But the boxes, circles, polygons and ropes stop rendering and disappear at exacly 100 million.
Those issues are probably bugs in the Algodoo software. Unfortunately, the company, Algoryx, has no plan to update the software, and so we will just have to live with any bugs it has. :(
Yup.
This is the largest number that the FP system will understand. It is 340,282,366,920,938,463,463,374,607,431,768,211,45­6
Why would you need any numbers larger than that? )|(
No. I said it because the number I said was maybe 1 step (mantissa unit) away from the Infinity mark. And also, because Algodoo no longer uses DFP (double floating point) anymore. This means that that ALL of the calculations are FP.
And also, I will need them very rarely. Like a experiment for example.
You said: ".... because Algodoo no longer uses DFP (double floating point) anymore." I did not know that! How did you find out about it? In the forum? :s
Last edited at 2017/06/01 16:14:05 by Xray
No. In the changelog.
On version 1.9.8 beta it said I think "IMP: Algodoo once again uses single precision float math (it was double during the earlier betas). This will speed up most things."
You can see it in the changelog. (README file)
Ah... Yes, you are correct! I usually don't read the README file (my bad), even when Algodoo was in development. If I had, then I would have been more up-to-date on the news about its FP math and such things.

Thanks for the update! :tup:
No problem.