in reply to Strange Logic in Power of arithmetic

Hello stephanm,

What version of Perl are you using? On v5.14.4 and v5.20.2 I get this:

23:07 >perl 1512_SoPW.pl Power of calculation test line 1: -8 line 2: -1.#IND line 3: -1.#IND line 4: -1.#IND 23:07 >

On v5.22.0 and v5.22.1 I get:

23:06 >perl 1512_SoPW.pl Power of calculation test line 1: -8 line 2: NaN line 3: NaN line 4: NaN 23:06 >

— as you expected.

Update: I’m using Strawberry Perl on Windows 8.1, 64-bit.

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Strange Logic in Power of arithmetic
by choroba (Cardinal) on Jan 12, 2016 at 13:18 UTC
    5.10.1 linux 64 bit:
    line 1: -8 line 2: nan line 3: nan line 4: nan
    5.8.3 linux 32 bit:
    line 1: -8 line 2: -nan line 3: -nan line 4: -nan
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
Re^2: Strange Logic in Power of arithmetic
by hotchiwawa (Scribe) on Jan 12, 2016 at 13:22 UTC
    Perl 5.20.2 (strawberryPerl - Windows):
    Power of calculation test line 1: -8 line 2: -1.#IND line 3: -1.#IND line 4: -1.#IND