2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
6 /* Because fload is defined to "int" later below,
7 and we still need the real float in some places */
9 typedef float realfloat
;
17 /* !!!! Where you see "float" later below, "int" will be
18 used instead by the compiler !!!! */
22 /* Because of the define above, the math protos/defines are
23 changed in such a way that all parameters are assumed to
24 be integers and also the return value is assumed to be
27 #include <proto/exec.h>
28 #include <proto/mathffp.h>
29 #include <proto/mathtrans.h>
30 #include <libraries/mathffp.h>
33 struct MathBase
*MathBase
;
34 struct MathTransBase
*MathTransBase
;
36 realfloat
converttofloat(float ffpfloat
)
46 void domul(realfloat a
, realfloat b
)
48 union kludge x
, y
, res
;
56 res
.i
= SPMul(x
.i
, y
.i
);
59 printf("mathffp : %f x %f = %f (hex %x)\n",
60 converttofloat(x
.i
), converttofloat(y
.i
), converttofloat(res
.i
), res
.i
);
61 printf("realfloat: %f x %f = %f\n",
68 MathBase
= (struct MathBase
*)OpenLibrary("mathffp.library", 0);
69 if (!MathBase
) return;
71 /* mathtrans.library is needed for SPFieee() function to convert
72 a float to IEEE floating point format */
74 MathTransBase
= (struct MathTransBase
*)OpenLibrary("mathtrans.library", 0);
75 if (!MathTransBase
) return;
87 CloseLibrary((struct Library
*)MathTransBase
);
88 CloseLibrary((struct Library
*)MathBase
);