precs of BigDecimal : BigDecimal « Number « Ruby






precs of BigDecimal


require 'bigdecimal'

puts BigDecimal("2").precs                        # => [4, 8]
puts BigDecimal("2.000000000000").precs           # => [4, 20]
puts BigDecimal("2.000000000001").precs           # => [16, 20]

 








Related examples in the same category

1.Big decimal calculation
2.Calculation on BigDecimal in a function
3.Convert big decimal to string
4.to_f cuts numbers
5.split a big number
6..to_s("F")
7.Convert BigDecimal to string
8.Add value to BigDecimal
9.Round a BigDecimal
10.Get the square root for a BigDecimal
11.PI in BigDecimal