Min: Difference between revisions

From Fancade Wiki
m (Adapt "Can I avoid using IF for X = Y statements?" article from old wiki)
(Improve description)
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
}}
}}


Outputs the smaller [[number]].
Outputs the smaller of the two input [[number]]s.


{{Image|Min example.jpg|The minimum of 3 and 5 is 3. The minimum of -2 and 0 is -2.}}
{{Image|Min example.jpg|The minimum of 3 and 5 is 3. The minimum of -2 and 0 is -2.}}
Line 14: Line 14:
== Notes ==
== Notes ==


If one of the inputs are ''nan'', the other value will be outputted regardless. This can be used in conjunction with [[Divide]], to create an equality test without ever using an [[If]]:
* If one of the inputs is <code>nan</code>, the other value will be outputted regardless.  
 
{{Image|Equal numbers no if.png}}


== Related ==
== Related ==

Latest revision as of 00:44, 23 August 2025

Min
Min.png
TypeScript block
ColliderNone
FolderMath
Ports
Inputs Num1
Num2
Outputs Smaller Num

Outputs the smaller of the two input numbers.

The minimum of 3 and 5 is 3. The minimum of -2 and 0 is -2.

Notes

  • If one of the inputs is nan, the other value will be outputted regardless.

Related