- Home /
Int inspector field approximation...
Hi,
I need to input a int, 999999980 and the inspector actually approximate it... to 1000000000
Note, it does keep the true value in the script itself, don't know how this all work out..
How can I tell the inspector NOT to approximate the values I input during authoring?
Thanks,
Jean
Answer by _Petroz · Feb 21, 2011 at 08:46 AM
In short, you cant. There is a limit to the number of possible values which can represented by a 32-bit floating point number.
http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
uhm ,I am talking about int here, not floating point values, but maybe this applies as well somehow.
no ints should be fine up to 2147483647. Unless it is internally getting converted to a float which may introduce accuracy issues. I ran a test and I cannot work out anyway to get this value of 999999980.
I find hard to believe that they can't show the proper value in the inspector especially since this is just strings representations of the value itself. I guess it's just an optimization of some sort that wasn't verified fully and left as is.