Equal Numbers: Difference between revisions

From Fancade Wiki
(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...")
 
(Updated the page)
Line 1: Line 1:
[[width=336px,alt=Equal Numbers|/uploads/Equal Numbers.png]]
{{Block
|image=Equal Numbers.png
|type=s
|folder=math
|input1={{Port|n|Num1}}
|input2={{Port|n|Num2}}
|output1={{Port|t|Num1 = Num2}}
}}


Outputs `True` if both [[number]] inputs are equal, and false if they are not.
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]]
[[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 _close enough_.
The numbers do not have to be actually equal to be considered equal, they have to be ''close enough''.


[[File:equal-not-precise.png]]
[[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.png]]
[[File:precise-equals.jpg|thumb|none|Does not have the same issue as the example above]]




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

Revision as of 11:57, 18 May 2024

Equal Numbers
Equal Numbers.png
TypeScript block
ColliderNone
FolderMath
Ports
Inputs Num1
Num2
Outputs Truth

Outputs `True` if both number inputs are equal, and false if they are not.

Example
Example

Notes

The numbers do not have to be actually equal to be considered equal, they have to be close enough.

0.001 is equal to 0

If high precision is required, the following script can be used:

Does not have the same issue as the example above