Non-canonical hexadecimal floats are parsed prematurely #15120
Created by firstname.lastname@example.org
I am so glad Perl 5.22 adds support to the C99 hexadecimal floating point notation. What I am not so glad is I found that perl sometimes parses hex floats prematurely.
% perl -E 'say sprintf "%a", 0x0.b17217f7d1cf78p0 - 0x1.62e42fefa39efp-1'
As you see, LHS is non-normal form and RHS normal. AFAIK in other platforms that support hexfloats 0x0.b17217f7d1cf78p0 == 0x1.62e42fefa39efp-1:
Dan the Bit-Picking Perl Monger
Works fine for me on MS Windows, perl-5.22.0:
C:\>perl -E "say sprintf '%a', 0x0.b17217f7d1cf78p0 - 0x1.62e42fefa39efp-1"
A regression ?
On Thu, Jan 07, 2016 at 01:42:01PM +1100, email@example.com wrote:
the maint-5.22 branch now prints 0x0p+0, as well as perl-5.23.0 onwards.