Another thing I've bumped into in my travels:

> From: Zefram
> Sent: Thursday, February 18, 2016 4:08 AM
> To: perl5-port...@perl.org
> Subject: Re: [perl #127182] One digit short to correctly stringify a double

>> To have different NVs stringify identically is surprising; to have the
>> closest approximation to 0.1 stringify other than "0.1" is also
>> surprising; so I think Steele's rule specifically achieves least surprise
>> here.

> I keep forgetting that perl has a thing about minimising surprises - and
> that's probably a good enough reason for perl to abide by Steele's rule.
> So I'll now accept that I can live with that :-)

> The hex form of 0.1 is 0x1.999999999999ap-4, and whenever that double is
> printed, I gather Steele's rule will decree that it be printed out as
> '0.1' - irrespective of whether that double was derived as 1/10 or
> 10000000000000001/1e17.
> But there's nothing to object about in that, AFAICS.

> Anyway, as I've already noted, one can always resort to printf if need be.

Remember that? Am I right in thinking that your view remains
that you can live with the above?

That all sounds good to me, though there can be different dimensions
of surprise, and it may be that Raku's take on having different Nums
stringify identically is different from Zefram's/Steele's/your formulation.

One thing I'm unclear on as yet is whether Raku has the same or a
different position than the above in principle, modulo bugs / weakness
in the current sprintf implementation.

--
raiph

Reply via email to