- Home /
Question by
HTH_jjpprogrammer · Sep 24, 2010 at 03:52 PM ·
variablefloat
What does it mean when you type a variable to float?
What does it mean when you type a variable to float?
Comment
Answer by duck · Sep 24, 2010 at 04:07 PM
It means the variable contains a numeric value stored in floating point representation.
These are typically used when you need fractional values (non integers), or when you need to represent numbers which are too large or too small to be represented by integers.
Fore more general information about floating point numbers, read the Wiki page linked above, and for the specific details of how they are used in Unity's c#, see this MSDN page:
http://msdn.microsoft.com/en-us/library/b1e65aza%28VS.71%29.aspx
(These details are the same for Unity's Javascript, only the syntax changes).
I saw this yesterday and assumed it was a trick question :) upvote.