home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / dev / c / rkrm / math / spieee.c < prev    next >
C/C++ Source or Header  |  1992-09-03  |  2KB  |  57 lines

  1. ;/* spieee.c - Math SP IEEE example of SPMul().  Run from CLI only!
  2. LC -b1 -cfistq -fi -v -y -j73 spieee.c
  3. Blink lib:c.o+spieee.o TO spieee LIB lib:lcmieee.lib+lib:lc.lib+lib:amiga.lib
  4. quit
  5. */
  6.  
  7. /*
  8. Copyright (c) 1992 Commodore-Amiga, Inc.
  9.  
  10. This example is provided in electronic form by Commodore-Amiga, Inc. for
  11. use with the "Amiga ROM Kernel Reference Manual: Libraries", 3rd Edition,
  12. published by Addison-Wesley (ISBN 0-201-56774-1).
  13.  
  14. The "Amiga ROM Kernel Reference Manual: Libraries" contains additional
  15. information on the correct usage of the techniques and operating system
  16. functions presented in these examples.  The source and executable code
  17. of these examples may only be distributed in free electronic form, via
  18. bulletin board or as part of a fully non-commercial and freely
  19. redistributable diskette.  Both the source and executable code (including
  20. comments) must be included, without modification, in any copy.  This
  21. example may not be published in printed form or distributed with any
  22. commercial product.  However, the programming techniques and support
  23. routines set forth in these examples may be used in the development
  24. of original executable software products for Commodore Amiga computers.
  25.  
  26. All other rights reserved.
  27.  
  28. This example is provided "as-is" and is subject to change; no
  29. warranties are made.  All use is at your own risk. No liability or
  30. responsibility is assumed.
  31. */
  32.  
  33. #include <clib/exec_protos.h>
  34. #include <libraries/mathieeesp.h>
  35.  
  36. #include <clib/mathieeesingbas_protos.h>
  37. #include <clib/alib_stdio_protos.h>
  38.  
  39. struct Library *MathIeeeSingBasBase;
  40.  
  41. VOID main(void)
  42. {
  43.  
  44. FLOAT mul1= -3.6, mul2=18.7;  /* 3.6 multiplied by 18.7 */
  45. FLOAT result;
  46.  
  47. if (MathIeeeSingBasBase = OpenLibrary("mathieeesingbas.library",34))
  48.     {
  49.     result = IEEESPMul(mul1,mul2);
  50.     printf("%f multiplied by %f = %f\n",mul1,mul2,result);
  51.  
  52.     CloseLibrary(MathIeeeSingBasBase);
  53.     }
  54. else
  55.     printf("Can't open mathieeesingbas.library\n");
  56. }
  57.