in reply to Re^9: NaN output
in thread NaN output
you could start with a couple of IV's and generate a NaN.
The problem (for me) is that there are no IVs involved in your construction.
The basic compile-time constant: 2**1025 never results in the construction of any IVs.
The interpreter constructs a compile-time constant from the expression and stores it as an NV:
Perl> use Devel::Peek;; Perl> $x = 2**1025;; Perl> Dump( $x );; SV = NV(0xb4598) at 0x3d73ee8 REFCNT = 1 FLAGS = (NOK,pNOK) NV = 1.#INF
And then at runtime, one NV (value 1.#INF) is divided by another NV (also 1.#INF) and the results is an NV (value: -1.#IND):
$y = $x / $x;; Dump $y;; SV = NV(0xb45a0) at 0x3d6c6a8 REFCNT = 1 FLAGS = (NOK,pNOK) NV = -1.#IND
No IVs were ever involved because the textual integer expression from the source code never made into the byte-coded Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: NaN output
by syphilis (Archbishop) on Mar 06, 2014 at 23:46 UTC | |
by BrowserUk (Patriarch) on Mar 07, 2014 at 00:38 UTC | |
by syphilis (Archbishop) on Mar 07, 2014 at 01:56 UTC | |
by BrowserUk (Patriarch) on Mar 07, 2014 at 02:06 UTC | |
by syphilis (Archbishop) on Mar 07, 2014 at 03:36 UTC | |
|