in reply to Re^2: Problems with values expressed in scientific notation not being returned through DBI
in thread Problems with values expressed in scientific notation not being returned through DBI
While unsure about what is going on, i must admit that was a totally unexpected result
i was wondering if you had run into something called a dualvar.
Resultuse strict; use warnings; $|=1; use Scalar::Util qw(dualvar); use Devel::Peek; print "nv1\n"; my $nv1 = 1e-2 ;Dump($nv1); print "nv1: +$nv1 ".($nv1+0)."\n"; Dump($nv1); print "dv2\n"; my $dv2 = dualvar( 1e-2, "hi" );Dump($dv2); print "dv2: +$dv2 ".($dv2+0)."\n"; Dump($dv2);
Of particular interest here is the line "dv2:hi 0.01" where in string context you get hi, but in numeric you get 0.1. But it doesnt seem that dualvars are your problem.nv1 SV = NV(0xa7c024) at 0xa3e614 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 0.01 nv1:0.01 0.01 SV = PVNV(0x3f7364) at 0xa3e614 REFCNT = 1 FLAGS = (PADMY,NOK,pIOK,pNOK) IV = 0 NV = 0.01 PV = 0xa959d4 "0.01"\0 CUR = 4 LEN = 36 dv2 SV = PVNV(0x3f73c4) at 0xa8facc REFCNT = 1 FLAGS = (PADMY,NOK,POK,pNOK,pPOK) IV = 0 NV = 0.01 PV = 0xa45c5c "hi"\0 CUR = 2 LEN = 10 dv2:hi 0.01 SV = PVNV(0x3f73c4) at 0xa8facc REFCNT = 1 FLAGS = (PADMY,NOK,POK,pIOK,pNOK,pPOK) IV = 0 NV = 0.01 PV = 0xa45c5c "hi"\0 CUR = 2 LEN = 10
|
|---|