in reply to Re^2: return +0
in thread return +0

I belive '+' has some importance.

For me, return values of +0, -0, and 0 are indistinguishable from each other - which means that the '+' has no significance at all:
C:\_32>perl -MDevel::Peek -e "Dump(+0)" SV = IV(0x1fe2d28) at 0x343cbc REFCNT = 1 FLAGS = (PADBUSY,PADTMP,IOK,READONLY,pIOK) IV = 0 C:\_32>perl -MDevel::Peek -e "Dump(-0)" SV = IV(0x432d2c) at 0xd73cec REFCNT = 1 FLAGS = (PADBUSY,PADTMP,IOK,READONLY,pIOK) IV = 0 C:\_32>perl -MDevel::Peek -e "Dump(0)" SV = IV(0x2492d28) at 0x23cbc REFCNT = 1 FLAGS = (PADBUSY,PADTMP,IOK,READONLY,pIOK) IV = 0
(Replace the double quotes with single quotes if you're on a *nix-type operating system.)

Cheers,
Rob

Replies are listed 'Best First'.
Re^4: return +0
by diotalevi (Canon) on Nov 27, 2007 at 16:53 UTC

    Just note that -.0 is distinct from .0.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      Perhaps you could be less vague. There is no such distinction in my tests:

      > perl -MDevel::Peek -e"Dump(+.0)" SV = NV(0xa4a5fc) at 0x3d53c4 REFCNT = 1 FLAGS = (PADBUSY,PADTMP,NOK,READONLY,pNOK) NV = 0 > perl -MDevel::Peek -e"Dump(-.0)" SV = NV(0xa4a60c) at 0x3d53f4 REFCNT = 1 FLAGS = (PADBUSY,PADTMP,NOK,READONLY,pNOK) NV = 0 > perl -MDevel::Peek -e"Dump(.0)" SV = NV(0xa4a5fc) at 0x3d53c4 REFCNT = 1 FLAGS = (PADBUSY,PADTMP,NOK,READONLY,pNOK) NV = 0

      - tye        

        It depends on the math libraries? They're different here, at least:

        sidhekin@blackbox[23:22:41]~$ perl -MDevel::Peek -le 'Dump(.0)' SV = NV(0x816e490) at 0x814dce4 REFCNT = 1 FLAGS = (PADBUSY,PADTMP,NOK,READONLY,pNOK) NV = 0 sidhekin@blackbox[23:22:51]~$ perl -MDevel::Peek -le 'Dump(-.0)' SV = NV(0x816e4a0) at 0x814dd20 REFCNT = 1 FLAGS = (PADBUSY,PADTMP,NOK,READONLY,pNOK) NV = -0 sidhekin@blackbox[23:22:53]~$

        print "Just another Perl ${\(trickster and hacker)},"
        The Sidhekin proves Sidhe did it!