Thanks!! I had, foolishly, not considered that the displayed base 10 might be rounded.

Several literals slightly larger than 1.797693134862314e+308 are converted to non-infinite numbers, including two in the following test that are converted to what I believe is the largest possible value.

use strict; use warnings; use Devel::Peek; foreach my $x ( [ '1.797693134862314e+308' , 1.797693134862314e+308 ], [ '1.7976931348623141e+308' , 1.7976931348623141e+308 ], [ '1.7976931348623142e+308' , 1.7976931348623142e+308 ], [ '1.7976931348623143e+308' , 1.7976931348623143e+308 ], [ '1.7976931348623144e+308' , 1.7976931348623144e+308 ], [ '1.7976931348623145e+308' , 1.7976931348623145e+308 ], [ '1.7976931348623146e+308' , 1.7976931348623146e+308 ], [ '1.7976931348623147e+308' , 1.7976931348623147e+308 ], [ '1.7976931348623148e+308' , 1.7976931348623148e+308 ], [ '1.7976931348623149e+308' , 1.7976931348623149e+308 ], [ '1.7976931348623150e+308' , 1.7976931348623150e+308 ], [ '1.7976931348623151e+308' , 1.7976931348623151e+308 ], [ '1.7976931348623152e+308' , 1.7976931348623152e+308 ], [ '1.7976931348623153e+308' , 1.7976931348623153e+308 ], [ '1.7976931348623154e+308' , 1.7976931348623154e+308 ], [ '1.7976931348623155e+308' , 1.7976931348623155e+308 ], [ '1.7976931348623156e+308' , 1.7976931348623156e+308 ], [ '1.7976931348623157e+308' , 1.7976931348623157e+308 ], [ '1.7976931348623158e+308' , 1.7976931348623158e+308 ], [ '1.7976931348623159e+308' , 1.7976931348623159e+308 ], ) { my ($string, $number) = @$x; print "$string\n"; Dump($number); my $foo = pack('d', $number); Dump($foo); print "\n"; } __END__ 1.797693134862314e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\366\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623141e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\367\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623142e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\367\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623143e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\370\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623144e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\370\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623145e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\371\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623146e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\372\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623147e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\372\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623148e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\373\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623149e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486231e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\373\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623150e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\374\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623151e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\374\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623152e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\375\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623153e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\375\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623154e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\376\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623155e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\376\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623156e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\377\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623157e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 1.79769313486232e+308 SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\377\377\377\377\377\377\357\177"\0 CUR = 8 LEN = 12 1.7976931348623158e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = inf SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\0\0\0\0\0\0\360\177"\0 CUR = 8 LEN = 12 1.7976931348623159e+308 SV = NV(0x88c58c8) at 0x88f0b50 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = inf SV = PV(0x88ed958) at 0x88f0bc0 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x88a7308 "\0\0\0\0\0\0\360\177"\0 CUR = 8 LEN = 12

In reply to Re^2: Large floating point literals by ig
in thread Large floating point literals by ig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.