Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

BigDecimal#to_f

to_f

Returns a new Float object having approximately the same value as the BigDecimal number. Normal accuracy limits and built-in errors of binary Float arithmetic apply.

See also #to_digits #to_i #to_d #to_int also in 3.2 · 3.1 · 3.0