RosettaCodeData/Task/Detect-division-by-zero/Sidef/detect-division-by-zero-1.sidef
2017-09-25 22:28:19 +02:00

7 lines
150 B
Text
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

func div_check(a, b){
var result = a/b
result.abs == Inf ? nil : result
}
 
say div_check(10, 2) # 5
say div_check(1, 0) # nil (detected)