mje has asked for the wisdom of the Perl Monks concerning the following question:
I'm having a problem making a patch to a module work which contains the following code:
/* sv contains "aa" i.e., SvPOK(sv) is true and pv="aa" sv_2nv(sv); cast_ok = SvNOK(sv); /* now cast_ok contains 512! */ /* and SvNV(sv) is 0 */
sv contains "aa" in pv and was created by $val = "aa". Printing SvPV_nolen confirms pv contains "aa". Since "aa" is not a valid double then why is SvNV true and why does SvNV return 0?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why does sv_2nv on non-number look like an NV
by Anonymous Monk on Nov 26, 2009 at 13:51 UTC | |
by mje (Curate) on Nov 26, 2009 at 14:02 UTC | |
by ikegami (Patriarch) on Nov 26, 2009 at 15:41 UTC | |
by mje (Curate) on Nov 26, 2009 at 15:48 UTC | |
by almut (Canon) on Nov 26, 2009 at 16:00 UTC | |
| |
by ikegami (Patriarch) on Nov 26, 2009 at 16:08 UTC | |
|