digitalmars.D.learn - sin(float), cos(float)
- bearophile (11/11) Apr 19 2011 In the C standard library there are the sqrtf, cosf, sinf functions, tha...
- bearophile (1/1) Apr 20 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5866
In the C standard library there are the sqrtf, cosf, sinf functions, that return a 32 bit float. In D std.math.sqrt returns a float if the input argument is float, but sin and cos return double even if their argument is float: import std.math: sqrt, sin, cos; void main() { float x = 1.0f; static assert(is(typeof( sqrt(x) ) == float)); // OK static assert(is(typeof( sin(x) ) == float)); // ERR static assert(is(typeof( cos(x) ) == float)); // ERR } I think this is not correct, and it's worth a Bugzilla entry (if not already present). Do you agree? Bye, bearophile
Apr 19 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5866
Apr 20 2011