digitalmars.D - Problem¦with¦COS
- Luis¦Rodrigues <Luis¦Rodrigues_member pathlink.com> May 08 2004
- J Anderson <REMOVEanderson badmama.com.au> May 08 2004
- hellcatv hotmail.com May 08 2004
I¦have¦this¦code:
printf("%f\n",¦cos(0.883573));
and¦it¦prints¦-0.0000,¦why?
I've¦imported¦std.math
Thanks.
_LR_
May 08 2004
Luis¦Rodrigues wrote:I¦have¦this¦code: printf("%f\n",¦cos(0.883573)); and¦it¦prints¦-0.0000,¦why? I've¦imported¦std.math Thanks. _LR_
printf("%f\n", cast(float) cos(0.883573)); -- -Anderson: http://badmama.com.au/~anderson/
May 08 2004
I had trouble linking when using cos in gdc
my solution was to use version and cosl
cos worked fine for me in dmd.exe
import std.c.math;
import std.math;
version(Windows) {
return std.math.cos(x);
}else {
return cast(VALUE)std.c.math.cosl(cast(real)x);
}
In article <c7j5gn$1qka$1 digitaldaemon.com>, Luis¦Rodrigues says...
I¦have¦this¦code:
printf("%f\n",¦cos(0.883573));
and¦it¦prints¦-0.0000,¦why?
I've¦imported¦std.math
Thanks.
_LR_
May 08 2004









J Anderson <REMOVEanderson badmama.com.au> 