Equal Numbers: Difference between revisions
Nikitaivanov (talk | contribs) (Created page with "/uploads/Equal Numbers.png Outputs `True` if both number inputs are equal, and false if they are not. File:Screenshot_2022-02-15-09-49-13-04_6c69499164362a0dbe2f1dfe7c62199a.jpg == Notes == The numbers do not have to be actually equal to be considered equal, they have to be _close enough_. File:equal-not-precise.png If high precision is required, the following script can be used File:precise-equals.png Category...") |
-u ndefined- (talk | contribs) m (Include more relevant blocks) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Block | |||
|image=Equal Numbers.png | |||
|type=s | |||
|folder=math | |||
|input1={{Port|n|Num1}} | |||
|input2={{Port|n|Num2}} | |||
|output1={{Port|t|<nowiki>Num1 = Num2</nowiki>}} | |||
}} | |||
Outputs | Outputs <code>True</code> if both [[number]] inputs are equal, and false if they are not. | ||
[[File: | [[File:Equal Numbers example.jpg|frameless|center|Example]] | ||
== Notes == | == Notes == | ||
The numbers do not have to be actually equal to be considered equal, they have to be | * The numbers do not have to be actually equal to be considered equal, they have to be ''close enough''. | ||
[[File: | : [[File:Equal-not-precise.jpg|thumb|none|0.001 is equal to 0]] | ||
If high precision is required, the following script can be used | : If high precision is required, the following script can be used: | ||
[[File:precise-equals. | : [[File:precise-equals.jpg|thumb|none|Does not have the same issue as the example above]] | ||
* You can check whether a number is valid by checking whether it is equal to itself. <code>nan</code>, <code>inf</code> and <code>-inf</code> are not considered equal to themselves because they represent a set of numbers. | |||
: [[File:Equal_nan_inf.png|thumb|none|NaN and Infinity are not equal to themselves]] | |||
== Related == | |||
* [[Less Than]] | |||
* [[Greater Than]] | |||
* [[Equal Vectors]] | |||
* [[Equal Truths]] | |||
* [[Equal Objects]] | |||
[[Category:Blocks]] | [[Category:Blocks]] |
Latest revision as of 13:48, 29 July 2025
Equal Numbers
Type | Script block |
Collider | None |
Folder | Math |
Ports | |
---|---|
Inputs | Num1 Num2 |
Outputs | Num1 = Num2 |
Outputs True
if both number inputs are equal, and false if they are not.

Notes
- The numbers do not have to be actually equal to be considered equal, they have to be close enough.
- If high precision is required, the following script can be used:
- You can check whether a number is valid by checking whether it is equal to itself.
nan
,inf
and-inf
are not considered equal to themselves because they represent a set of numbers.