Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What's the difference between a number, float, and double?

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.

5 comments

0

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

0

So what is a float?

0

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.

0

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

0

Thanks.

1 answer

✓ Accepted answer

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

2 comments

0

Thank you.

0

You are welcome

This discussion is preserved as it was. New answers, comments, and votes are closed.