avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] Pow Function in avr8


From: Georg-Johann Lay
Subject: Re: [avr-libc-dev] Pow Function in avr8
Date: Thu, 29 Nov 2012 00:44:25 +0100
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Jan Waclawek schrieb:
Floating point equivalence is not guaranteed so is this comparison
valid ?

C99 in 5.2.4.2.2#5 says: The accuracy ofthe floating-point operations
(+, -, *, /) and of the library functions in <math.h>and <complex.h>
that return floating-point results is implementation-defined [...]
The implementation may state that the accuracy is unknown.

Which is the case, cf. [1]:

* The accuracy of the floating-point operations and of the library
  functions in <math.h> and <complex.h> that return floating-point
  results (C90 and C99 5.2.4.2.2).

  The accuracy is unknown.

Which basically means precision is a matter of the target.
The (E)ABI of avr-gcc does not define floating point precision,
at least I don't know of it.  Similar for AVR Libc.

PS. Are you sure you linked against avr-libc's math library?

FYI and in the case you refer to whether -lm is used or not:
That won't matter in new avr-gcc, cf. [2]

Johann


[1]
http://gcc.gnu.org/onlinedocs/gcc/Floating-point-implementation.html

[2]
http://gcc.gnu.org/PR54461




reply via email to

[Prev in Thread] Current Thread [Next in Thread]