Integer comparison: Difference between revisions

No edit summary
Line 2,021:
 
{{FormulaeEntry|page=https://formulae.org/?script=examples/Integer_comparison}}
 
'''Solution'''
 
Fōrmulæ has an intrinsic expression for [[wp:Three-way_comparison|three-way comparison]] that works for integers and other types (decimal and rational numbers, strings, time expressions, etc). It returns expressions that flag one of the three possible results.
 
[[File:Fōrmulæ - Integer comparison 01.png]]
 
[[File:Fōrmulæ - Integer comparison 02.png]]
 
However, a simple function can be written for the requirement:
 
[[File:Fōrmulæ - Integer comparison 03.png]]
 
[[File:Fōrmulæ - Integer comparison 04.png]]
 
[[File:Fōrmulæ - Integer comparison 05.png]]
 
=={{header|Go}}==
2,120

edits