April 19, 2011 sin(float), cos(float) | ||||
---|---|---|---|---|
| ||||
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 |
April 20, 2011 Re: sin(float), cos(float) | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | http://d.puremagic.com/issues/show_bug.cgi?id=5866 |
Copyright © 1999-2021 by the D Language Foundation