Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / ValFloat bug?

Author
Message
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 2nd Apr 2018 21:57
The following code

will give
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 2nd Apr 2018 22:23 Edited at: 2nd Apr 2018 22:24
Its not a bug.

Its a limitation of 32bit floating point numbers (IEEE-754) and occurs in all programming languages that use this type of variable. The number 123456789 cant actually be represented by a 32bit float number. Not completely accurately.

Floating point numbers do not have an infinite resolution. Even using double precision(64bit) there is a limit to the actual numbers that can be stored (not that we can use doubles in AGK...yet)

https://www.h-schmidt.net/FloatConverter/IEEE754.html

Try a few numbers in the website above and you will see that there are MANY numbers that you cant actually store in a float.
george++
AGK Tool Maker
16
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 2nd Apr 2018 22:36
Thank you for the info

Login to post a reply

Server time is: 2024-03-28 23:43:51
Your offset time is: 2024-03-28 23:43:51