Chris Marshall
2014-04-30 18:44:29 UTC
It appears that one of the remaining problems
of the longlong-double-fix branch of PDL git is
that perl scalars are not correctly promoted
to piddles which leads to some sort of truncation
in mixed operations.
Here is a short session in pdl2 showing the
problem:
pdl> $d = 2 # ordinary perl scalar
pdl> $dpdl = pdl(2) # piddle with same value
pdl> p $d - $dpdl # subtracting gives 0, good
0
pdl> p $d - 2 # subtracting 2 from $d is 0
0
pdl> p $dpdl - 2 # subtracting 2 from $dpdl is 0
0
pdl> p $d - 2.0 # subtracting 2.0 from $d is 0
0
pdl> p $dpdl - 2.0 # BUT from $dpdl gives 2!!!
2
Any ideas where such a symptom could arise
or where the relevant code is? I don't have any
idea on where or how to trace the values here and
haven't been making much progress with fprintf
(not surprising since I don't know where to go...)
The latest version has been pushed to PDL git
on sf.net in the longlong-double-fix branch.
Thanks in advance!
Chris
of the longlong-double-fix branch of PDL git is
that perl scalars are not correctly promoted
to piddles which leads to some sort of truncation
in mixed operations.
Here is a short session in pdl2 showing the
problem:
pdl> $d = 2 # ordinary perl scalar
pdl> $dpdl = pdl(2) # piddle with same value
pdl> p $d - $dpdl # subtracting gives 0, good
0
pdl> p $d - 2 # subtracting 2 from $d is 0
0
pdl> p $dpdl - 2 # subtracting 2 from $dpdl is 0
0
pdl> p $d - 2.0 # subtracting 2.0 from $d is 0
0
pdl> p $dpdl - 2.0 # BUT from $dpdl gives 2!!!
2
Any ideas where such a symptom could arise
or where the relevant code is? I don't have any
idea on where or how to trace the values here and
haven't been making much progress with fprintf
(not surprising since I don't know where to go...)
The latest version has been pushed to PDL git
on sf.net in the longlong-double-fix branch.
Thanks in advance!
Chris