From: brabuhr@... Date: 2010-06-30T21:48:50+09:00 Subject: Re: Increase significant digits in Float On Wed, Jun 30, 2010 at 8:06 AM, Neve Le wrote: > Siep Korteling wrote: >>> Xavier Noria wrote: >>> That 15 is hard-coded in the definition of Float#to_s. >> >> Yes, and exposing more digits is not accurate: >> The float is bogus  after the 16th digit. > > Working with big numbers here, it seems that precision is only > guaranteed to 15 digits on either side of the decimal. When a whole > number >15 digits is divided the decimal is approximated, and anything >>17 digits prints a float of n.0 no matter how it's "%n.nf" formatted. http://ruby-doc.org/core/classes/Float.html "Float objects represent real numbers using the native architecture‘s double-precision floating point representation." http://en.wikipedia.org/wiki/Double_precision_floating-point_format You could try BigDecimal.