|
|
- NAME
- #include <libraries/mathffp.h>
#include <aros/libcall.h>
#include <proto/mathffp.h>
#include <proto/mathtrans.h>
#include <proto/exec.h>
#include <exec/types.h>
float SPLog10 ()
- SYNOPSIS
- float fnum1
- FUNCTION
- Calculate logarithm (base 10) of the given ffp number
- INPUTS
- fnum1
- Motorola fast floating point number
- RESULT
- ffp number
flags:
zero : result is zero
negative : result is negative
overflow : argument was negative
- NOTES
-
- EXAMPLE
- BUGS
-
- SEE ALSO
- MathTrans
- INTERNALS
- ALGORITHM:
If the Argument is negative set overflow-flag and return 0.
If the Argument is 0 return 0xde5bd8fe.
All other cases:
(ld is the logarithm with base 2)
(log is the logarithm with base 10)
fnum1 = M * 2^E
log fnum1 = log ( M * 2^E ) =
= log M + log 2^E =
= log M + E * log (2) =
ld M ld 2
= ----- + E * ----- = [ld 2 = 1]
ld 10 ld 10
ld M + E
= --------
ld 10
ld 10 can be precalculated, of course.
For calculating ld M see file intern_spld.c
|