RosettaCodeData/Task/Approximate-equality/Sidef/approximate-equality-2.sidef

7 lines
202 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
var a = 100000000000000.01
var b = 100000000000000.011
# Rounding at 2 and 3 decimal places, respectively
say (round(a, -2) == round(b, -2)) # true
say (round(a, -3) == round(b, -3)) # false