Hello there. This might seem like a dumb question, but what's the difference between a number, float, and double? Are they the same thing? Do they have slight differences? Here is the Roblox Developer Hub page that sparked my question.
Thank you.
Hello there. This might seem like a dumb question, but what's the difference between a number, float, and double? Are they the same thing? Do they have slight differences? Here is the Roblox Developer Hub page that sparked my question.
Thank you.
A number can be a variety of stuff, a decimal, a fraction, an int, whatever you want it to be..
A float is a miniature version of a double (less memory consumption) for storing small values.. 7 decimal places.
A double has 15 decimal places so all the data is more precise especially for marketing when you need precise data.
doubles and floats don't really matter on roblox since numbers are made just like:
local x = 1
local whatever = 1.032440238203480128012834
Thank you.
You are welcome
This discussion is preserved as it was. New answers, comments, and votes are closed.
5 comments
from what I understand a double is just twice as detailed as a float, meaning it can store a lot more decimals, I might be wrong about that but that's what I remember
So what is a float?
I looked into it a bit more and from what I gathered there a few types of numbers, Int, float, and double, and a few more that I don't need to mention, but basically a int("integer") is any whole number(no decimals) ; a float is a number with up to 7 decimal digits ; and a double is a number with up to 15 digits.
So while using a double number might be more precise, in most cases it is better to use a float because 1) it takes up less processing power and 2) we don't need that much precision in most situations
Thanks.