singleton method Float.induced_from
induced_from(num) -> Float
-
num を Float に変換した結果を返します。
p Float.induced_from(30) #=> 30.0 p Float.induced_from(Math::PI) #=> 3.14159265358979 begin Float.induced_from("1.732") rescue TypeError p $! #=> #<TypeError: failed to convert String into Float> end
class Float