AROSAmiga Research OS

Previous Next Top of Manual blank.gif

AROS - The Amiga Research OS


Documentation
    AutoDocs
        Exec.library
        MathFFP.library
            SPAdd
            SPCmp
            SPMul
            SPAbs
            SPCeil
            SPDiv
            SPNeg
            SPTst
            SPFloor
            SPFix
            SPSub
            SPFlt
        MathIEEEDoubleBase
        MathIEEEDoubleTrans
        MathIEEESingleBase
        MathIEEESingleTrans
        MathTrans
NAME
#include <libraries/mathffp.h>
#include <proto/mathffp.h>

LONG SPCmp ()

SYNOPSIS
float fnum1
float fnum2

FUNCTION
Compares two ffp numbers
INPUTS
fnum1
FFP number
fnum2
FFP number

RESULT

+1 : fnum1 > fnum2
0 : fnum1 = fnum2
-1 : fnum1 < fnum2


Flags:
zero     : fnum2 = fnum1
negative : fnum2 < fnum1
overflow : 0
NOTES
EXAMPLE

BUGS
SEE ALSO
MathFFP.library

INTERNALS
ALGORITHM:
1st case:
fnum1 is negative and fnum2 is positive
or
( exponent(fnum1) < exponent(fnum2) and signs are equal )
-> fnum1 < fnum2

2nd case:
fnum1 is positive and fnum2 is negative
or
( exponent(fnum1) > exponent(fnum2) and signs are equal )
-> fnum2 > fnum1

now the signs and exponents must be equal

3rd case:
fnum1 == fnum2

4th case:
mantisse(fnum1) < mantisse(fnum2)
-> fnum1 < fnum2

final case:
fnum1 > fnum2


Previous Next Top of Manual blank.gif
minilogo.gif

Amiga® is a trademark of Amiga Inc. All other trademarks belong to their respective owners.

Copyright © AROS - The Amiga Research OS
All Rights Reserved
Comments to webmaster: digulla@aros.org
Generated: Tue Sep 4, 2001