Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make pdl_whichdatatype_double work for NVSIZE > 8
A warning is now given if there is a loss of precision
to avoid user surprise.  With the increasing availability
of long double support, we need to add this to the list
for the new "PDL3" types.
  • Loading branch information
devel-chm committed Oct 2, 2015
1 parent 7a4c336 commit 02367f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Basic/Core/pdlcore.c.PL
Expand Up @@ -302,8 +302,12 @@ int pdl_whichdatatype_double (NV nv) {
TESTTYPE(PDL_D,PDL_Double)
if( !finite(nv) ) { return PDL_D; }
croak("Something's gone wrong: %lf cannot be converted by whichdatatype_double",
nv);
#if NVSIZE > 8
warn("Precision loss due to 'long double' to 'PDL_D' conversion!");
return PDL_D;
#else
croak("Something's gone wrong: %lf cannot be converted by whichdatatype_double", nv);
#endif
}
Expand Down

0 comments on commit 02367f9

Please sign in to comment.