Number: Difference between revisions

From Fancade Wiki
(Created page with "File:Number1.png Outputs a given value. To change the value to output, select the block, then tap the button right below the open inventory (+) button, in the bottom right corner. File:changenumvalue.png This will open up the keypad, which you can use to change the value that the number script block will output. == Notes == The number is the most common data type. Numbers are represented by blue wires. Numbers are stored as 32-bit floats. To be precise, th...")
 
m (Add Block template, rework formatting)
Line 1: Line 1:
[[File:Number1.png]]
{{Block
|image=Number.png
|type=s
|folder=Values
|output1={{Port|n}}
}}


Outputs a given value.
Outputs a given value.
Line 5: Line 10:
To change the value to output, select the block, then tap the button right below the open inventory (+) button, in the bottom right corner.
To change the value to output, select the block, then tap the button right below the open inventory (+) button, in the bottom right corner.


[[File:changenumvalue.png]]
[[File:Number_change_value.png]]


This will open up the keypad, which you can use to change the value that the number script block will output.
This will open up the keypad, which you can use to change the value that the number script block will output.
Line 13: Line 18:
The number is the most common data type. Numbers are represented by blue wires.
The number is the most common data type. Numbers are represented by blue wires.


Numbers are stored as 32-bit floats. To be precise, they are stored as [https://en.wikipedia.org/wiki/Single-precision_floating-point_format#IEEE_754_standard:_binary32|IEEE-754 floating point numbers].
Numbers are stored as 32-bit floats. To be precise, they are stored as [https://en.wikipedia.org/wiki/Single-precision_floating-point_format#IEEE_754_standard:_binary32 IEEE-754 floating point numbers].
This gives numbers a maximum value of **340,282,346,638,528,859,811,704,183,484,516,925,440**. Likewise, their minimum value is the negative of that.
This gives numbers a maximum value of  
 
:340,282,346,638,528,859,811,704,183,484,516,925,440.
 
Likewise, their minimum value is the negative of that.


Numbers have about 7 digits of precision. This means that numbers with 8 digits or more may begin to give slightly inaccurate results, e.g. when [[Add Numbers|adding]] numbers together. The margin of error is usually tiny, but gets larger the more digits you have.
Numbers have about 7 digits of precision. This means that numbers with 8 digits or more may begin to give slightly inaccurate results, e.g. when [[Add Numbers|adding]] numbers together. The margin of error is usually tiny, but gets larger the more digits you have.
Line 25: Line 34:
* [[Vector]]
* [[Vector]]
* [[Rotation]]
* [[Rotation]]


[[Category:Blocks]]
[[Category:Blocks]]

Revision as of 06:45, 21 May 2024

Number
Number.png
TypeScript block
ColliderNone
FolderValues
Ports
Outputs Number

Outputs a given value.

To change the value to output, select the block, then tap the button right below the open inventory (+) button, in the bottom right corner.

This will open up the keypad, which you can use to change the value that the number script block will output.

Notes

The number is the most common data type. Numbers are represented by blue wires.

Numbers are stored as 32-bit floats. To be precise, they are stored as IEEE-754 floating point numbers. This gives numbers a maximum value of

340,282,346,638,528,859,811,704,183,484,516,925,440.

Likewise, their minimum value is the negative of that.

Numbers have about 7 digits of precision. This means that numbers with 8 digits or more may begin to give slightly inaccurate results, e.g. when adding numbers together. The margin of error is usually tiny, but gets larger the more digits you have.

Numbers using decimals may also give rounding errors as well.

Related