Browse Search Popular Register Upload Rules User list Login:
Search:
Do not USE what floats say to you!

Image:
screenshot of the scene

Author: GoAnimateCPUAlgodoo

Group: Default

Filesize: 67.44 kB

Date added: 2017-08-08

Rating: 5

Downloads: 495

Views: 456

Comments: 31

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Do not USE what floats say to you!
Because floats are bad at precise numbers.
Listen, Thyme uses IEEE-754 single precision floats.
1 sign bit, 8 exponent bits and 23 mantissa bits.
The Mantissa is the one you have to listen for.
I added doubles so you can see the difference between precision.
Last edited at 2017/08/08 21:06:51 by GoAnimateCPUAlgodoo
Please log in to rate this scene
edit
Similar scenes
Title: Phun Flight Simulator 1.2 (floats version)
Rating: 5.25
Filesize: 113.77 kB
Downloads: 1099
Comments: 7
Ratings: 2
Date added: 2010/02/18 19:42:09
Made with: Phun
Rating: rated 5.3
download
Title: ISSUES WITH FLOATS
Rating: 5
Filesize: 67.98 kB
Downloads: 374
Comments: 15
Ratings: 1
Date added: 2017/04/26 17:00:46
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: 815
Comments: 0
Ratings: 1
Date added: 2022/07/31 21:14:42
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: the floating ball
Rating: 5
Filesize: 39.81 kB
Downloads: 282
Comments: 0
Ratings: 1
Date added: 2014/04/11 11:35:57
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Sinks floats
Rating: 5
Filesize: 459.05 kB
Downloads: 145
Comments: 0
Ratings: 1
Date added: 2014/08/19 00:51:01
Made with: Algodoo before v1.8.5
Rating: rated 5
download
Comment page previous | 1 2 | next
I am maybe now like a debugger for floats. I do not know why, but I am interested in floats all the time. So I sometimes make my own floats by using this formula: "2^exponent*(1+(mantissa/2^23))".
Well, there are many situations where floating point calculations are required because you cannot do those calculations using integers. I find that the Algodoo single precision floating point math is quite adequate for the game scenes that I make. As long as a user understands its limitations, he/she should be able to utilize it without any problems.
Yeah, but I use doubles mostly. But then converted to a float afterwards if there are issues with my projects.
I use Processing 3.2.1. Which supports doubles because it uses the programming language called 'Java'. But doubles take up more memory, so they are not used in functions except for 'text()'. Which supports it but with the string tag. Most of the functions that cannot be used in a double has to be converted to a float. Even the processing page for 'float' says "Floats are not precise!".
So this is why I use doubles a lot. Because a lot of my projects are text and number projects.
When you say "I use doubles mostly", what does that have to do with Algodoo? As far as I know, there is no way to choose whether Thyme scripting uses single or double floats. So, is your little rant about floats just in general, or are you referring specifically to Thyme scripting? You are not clear about that.
No, I meant processing scripts which I done a few months ago.
And I mean the processing language.
I was just concerned that you posted a scene in which you very LOUDLY say "Do not use what floats" and then you comment " Thyme uses IEEE-754 single precision floats." People reading that will probably be just as confused as I was wondering what you are talking about! About 90 percent of the users of Algodoo are children who have no idea what a floating point number is. And the users who do know, such as myself, are probably left with a puzzled look on their faces (like I was).

Friendly Suggestion: When you post a scene in which you rant about an issue, mention if Algodoo is affected by the issue, and if it is, post a suggestion that explains what can be done to correct or improve it. If Algodoo is NOT affected by the issue, then SAY THAT!

Thanks
Yeah, but this was if a value was decimal "0.1". It would NOT equal that and pass right through it.

Because if you reduct 0.1 by 0.1 as decimal, then you would get something like this: "1.4901161e-9". And this is why I did this project.

And a floating point number is simply a 32 bit integer with they are like sectors for each one. If this binary number
"110000001 10000000 00000000 00000000" was converted to a float. It would say "3". If it was larger like this:
"100000100 10001000 00000000 00000000". Then THIS would say "392". That is how it is.

The real number of 1.0000001192092896 would look like this:
1.000000000000000000001 in full binary with a decimal point. But the number I said IS NOT decimal. If it is a float and EVEN doubles would round it down to "1".

If I said this number as binary with a decimal point "10110.111" That number would be "46.875".

If they STILL do not know, they should see the Wikipedia page for floats.
I am sorry if I said a full novel there.
But still, I was a little bit mad about the thing you said about the FULL capital words there.
And a float in RAW form would be this:
"0 0000000 00000000000000000000000".

The first bit is the sign bit. That means if this is "1", It would be a negative value.

The second to ninth bits are exponent bits (8). These calculate to 0 to 255.
Because this is signed, It would be -126 to 127. And these are calculated by powers of 2 "Say like 2^3 for example".

The tenth to thirty-first bits are mantissa (23). These are values divided by the width of bits.

So the first bit will be added by "1.1920929e-7", The second will be added by "2.384195e-7" and so on.

If they wanna learn by messing with this system. They should go to
https://www.h-schmidt.net/FloatConverter. This is a 32-bit float system that you can use and mess around with.
WOW! You sure do know your floats! Are you by chance a mathematician or possibly a software engineer? Just wondering...

Sorry about the all caps. I use all caps to stress a point, not to yell at people. I meant no offense.

I'll check out that link to the Float Converter. Looks interesting!

Thanks
A mathematician. And I know it because I researched it a very long time ago (6 months) and remembered it every time by looking at how it was working.

You may not understand what I said at the top but, Thanks...
I would ALWAYS be interested on them because it is just simply how it works.

But did you know there was 16-bit (half), 128-bit (quadruple) and 256-bit (octuple) precision floats as well?
Also, can I show 0.1 at all the precision widths (16, 32, 64, 128, 256)?
I do have a basic understanding of floats because many years ago (I hate to say how many) I was involved with a group of engineers at a company that I worked for in finding a software floating point math package that would run in the medical instrument that the company produced. We found out the hard way, that running 16 bit floating point routines on a computer with an 8 bit processor and limited memory was way too slow. Even to calculate some basic statistical analysis (such as least squares fit, and standard deviation) took way too long. So, the electrical engineer on the project designed the next version of the CPU board around a hardware (actually firmware) version of a float package, and it ran at least ten times faster than the software version. Later we went with a 16 bit microprocessor, and then floating point math ran with the speed of light! A lesson learned....
Ok.
And, the more bits they use, the slower will get.
Preciseness depends on how many bits there are for mantissa.

Half precision has 4 digits of precision.
And a range of 0.000610352 to 65504.

Single precision has 8 digits of precision.
And a range of 1.1754944e-38 to 3.4028235e38

Double precision has 17 digits of precision.
And a range of 2.225073859e-308 to 1.797693135e308

Quadruple precision has 34 digits of precision.
And a range of 3.362103143e-4932 to 1.189731495e4932

Octuple precision has 71 digits of precision.
And a range of 2.482427951e-78913 to 1.611325717e78913
Atlease I was somewhat smarter here. I am embarassed at the second cookie clicker game I made. Stupid me! Stupid me!
Hey GoAnimateCPUAlgodoo --- My wife and I were watching a movie this evening that you might be interested in since you are a math wiz. The title is "UFO", and there are a lot of interesting discussions about math in the movie. It was on Amazon, but it may also be on Netflix or some other movie network. Here is a YouTube link to the movie trailer: https://www.youtube.com/watch?v=gxUcHrPhewY

Check it out! I think you would be interested in watching it.
I personally am not a guy who watches movies, but the trailer does look cool, thanks for sharing it! And also, how can I change my username since my original username is outdated for me now, I have a new username and identity now "Username: random player & qq". NOTE: "I am more of a programming wiz now. I still do math, but not as much as I did around 20 months ago." I have a project which I modify every so often when I come up with an idea for it. I don't feel like revealing the project name and it's identity right now.
Last edited at 2019/05/11 23:25:13 by GoAnimateCPUAlgodoo
I like the name "GoAni". LOL How about that for a user name? :lol:

Unfortunately, the only way that you can change to a different user name here on Algobox is to register with a different name and password (actually, you can use your old password if you want to), and then an Admin will have to ban your old user account. We need to do that because we do not allow each person to have more than one user account. Also, keep in mind that once you register a new user name and we ban your old one, you will never again be able to delete or modify any of your scenes that are currently stored on Algobox.

So, if you decide that you want to register a new user account, contact wild bill and he will take care of the details of banning your old user account.

By the way, I do not watch movies very much either unless they are technical, scientific, or documentaries. I love watching technical videos and movies that I can learn from. Based on what you said, it sounds like you have the same taste in movies and videos that I have. :tup:
Oh, I was just wondering how old you are. You don't have to tell me of course if you don't want to, but I was wondering if I am communicating with a child, or a teen, or an adult. That way I can structure my thoughts and my words more appropriately. I certainly don't want to talk to you as if you were a child if you are in fact an adult. I don't mind telling you that I am one of the "older" users here on Algobox. I am probably old enough to be your father or maybe even your grandfather.
Huh, well OK.:) I mainly only post comments at this point since if I make a scene and upload it, I feel like I would be criticized quite a bit for it even though I'm not too popular here in Algobox. NOTE: I hate posting very long comments that over 600 characters since I hate filling up room in the comments section.
Last edited at 2019/05/12 10:12:23 by GoAnimateCPUAlgodoo
So, does that mean you won't tell me how old you are?
I don't wanna bother you saying "I can't.", so I said that in the last comment instead, but no thanks.
That's perfectly Okay. And don't worry about not being "popular" here on (or in) Algobox. I don't think that there are popular people anyways. There are a few "Marble race" kids, and there are some "Camp" kids who bunch together to play their mindless and childish games with their static scenes, but as far as I can see, there really are no particular popular users. You are popular with me and with some of the other "technical" people because you make interesting "dynamic" scenes that do things. And you like mathematics. So, in that respect, YOU are popular! :tup:
Last edited at 2019/05/13 06:18:10 by Xray
Thank you!:)
Comment page previous | 1 2 | next