[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

2383.0. "fast floating point" by AUNTB::PRESSLEY () Tue Mar 21 1989 11:46

    I am trying to use the fast floating point functions in the
    mathffp.library.
    
    
    float x,y,z;
    
    x = 4;
    y =2;
    
    z = SPMul(x,y);
    
    I always get a value of zero for z;
    
    I am using lattice C v3.02
T.RTitleUserPersonal
Name
DateLines
2383.1CANTH::SPODARYKJefferson, I think we're lost.Tue Mar 21 1989 12:0621
    It was never very clear how to use the FFP functions in the 
    Lattice 3.0 docs.  I gave up and upgraded to 5.0 (and programming
    is much more pleasant now :^)  Now what I do is...
    
    #include <libraries/mathffp.h>
    .
    float x = 4, y = 2, z;
    .
    MathBase = OpenLibrary( "mathffp.library", REVISION );
    .
    z = x * y;         /* use floats as you would normally */
    
    I believe you also have to compile/link with the FFP option.  
    amiga> lc -ff -Lm test 
    
    You may not have to open the library.  I seem to remember getting
    the same performance by just using the compilation/link switches. 

    It's been several months since I used this stuff, so...
    
    --Steve
2383.2Standard C Programming Bug?TLE::RMEYERSRandy MeyersWed Mar 22 1989 18:4511
Re: .0

Do you declare the return type of the function anywhere?  If you don't,
the compiler will think it returns an int.

Re: .1

>    You may not have to open the library.

You do not have to open the library if you are using the standard Lattice
startup code.