[acos(-1) returns double but acos(1.) returns float]

> I'm not sure what the best fix is but the results should
> at least be consistent across the different functions.
> Since 1. is a float in C, the float output seems plausible
> but perhaps violating the rule of least surprise.  There

The default conversion in C is to double, so acos(-1) giving a double
makes sense. However, -1. is a double constant (the float version
would be -1.f).  Thus, acos(-1.) returning a float, converting
to a narrower type is *very* surprising.
 
> may be something on this in earlier perldl and pdl-porters
> archives, maybe before my time...  :-)
> 
> --Chris
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> 

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to