- Home /
What is the max float?
What is the max float decimals you can goto in unity3d?
@Dave Carlile has already provided the correct answer to your original question, although your follow-up comment was somewhat confusing.... why do you need a bigger value than the maximum value possible?
Answer by Dave-Carlile · Jun 18, 2015 at 06:00 PM
Debug.Log("Max Float=" + float.MaxValue);
Well... "max" is the maximum possible value by definition, isn't it?
You can try the double
data type. But if you're using to set any value in a Unity class it will need to be converted to float
at some point, resulting in a loss of precision.
float = 7 digits double = 15 digits
https://msdn.microsoft.com/en-us/library/ms173773.aspx
might be a better overview: https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx
Yep, and as soon as you assign the value to anything in a Unity class you'll have to cast it to float
and you'll lose precision.
I want to use a signature key number for something and it is very long. float can't handle it or double and I need float for the objects.