On 22/03/2014 20:16, Bob Brand wrote:
Hello Duncan,
In message you wrote:
printf("%f\n",sqrt(2.0));
Looks like you have fallen in a classic C pitfall:
passing a double argument to a vararg/stdarg function
but interpreting it as float.
No, "%f" is a correct format specifier for double.
Hello Duncan,
In message you wrote:
> printf("%f\n",sqrt(2.0));
Looks like you have fallen in a classic C pitfall:
passing a double argument to a vararg/stdarg function
but interpreting it as float.
Try either:
printf("%lf\n", sqrt(2.0));
Or:
printf("%f\n", (float) sqrt(2.0));
Reason: f
http://www.riscos.info/bugzilla3/show_bug.cgi?id=250
Summary: GCC 4.7.4 Rel 1 Dev 2014-01-08: sqrt function
Product: GCC/GCCSDK
Version: other
Platform: Other
OS/Version: RISC OS
Status: NEW
Severity: normal
Priorit