Absolute value and sign

2019-06-19 20:04栏目:技术创新
TAG:

puts -2.0.abs     # => 2.0: absolute value
puts -2.0<=>0.0   # => -1: use <=> operator to compute sign of a number

版权声明:本文由新浦京娱乐站_新浦京娱乐场官网_新浦京娱乐发布于技术创新,转载请注明出处:Absolute value and sign