On Tue, Aug 02, 2016 at 07:32:56PM +0100, Zefram wrote:
> Patrick R. Michaud via RT wrote:
> >I don't know that we should expect .perl or any other operation on Num
> >values to be preserving more precision than that.
> 
> I'd expect .perl to preserve whatever precision is there.  Accurately
> representing the value, in a form understandable by .EVAL, is its
> raison d'etre.
> [...]

Okay.  I'm agreeable to say that .perl (and perhaps sprintf where 
appropriate) should add two more digits of precision to the strings 
they produce, to preserve the round-trippiness of the values being
represented.

> (1180591620717411303424e0).perl
1.18059162071741e+21
> (1.18059162071741e+21).Int     # not enough precision
1180591620717409992704
> (1.180591620717411e+21).Int    # still not enough
1180591620717411041280
> (1.1805916207174113e+21).Int   # okay, this works
1180591620717411303424

Pm

Reply via email to