| 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 |
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.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 2383.1 | CANTH::SPODARYK | Jefferson, I think we're lost. | Tue Mar 21 1989 12:06 | 21 | |
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.2 | Standard C Programming Bug? | TLE::RMEYERS | Randy Meyers | Wed Mar 22 1989 18:45 | 11 |
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. | |||||