G
Giampiero Zanchi
ciao a tutti (hi to hall)
I just discoverd a gem to have arbitrary precision numbers and want to
share with the forum.
Install the gem with
gem install flt
an example script follows; it computes the square root of 2
require 'flt'
include Flt
DecNum.context.precision = 200
p DecNum(2).sqrt
produces:
DecNum('1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605715')
documentation here
http://flt.rubyforge.org/
hope this helps
I just discoverd a gem to have arbitrary precision numbers and want to
share with the forum.
Install the gem with
gem install flt
an example script follows; it computes the square root of 2
require 'flt'
include Flt
DecNum.context.precision = 200
p DecNum(2).sqrt
produces:
DecNum('1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309122970249248360558507372126441214970999358314132226659275055927557999505011527820605715')
documentation here
http://flt.rubyforge.org/
hope this helps