home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / new / dev / c / hce / examples / clib / tests / floattest.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  1KB  |  48 lines

  1. /*
  2.  * HCC 32 bit int scanf() and mathtrans test program by TetiSoft
  3.  */
  4.  
  5. /*
  6.  * Modified slightly by Jason Petty for HCE. (16/6/94)
  7.  * Changes marked VANSOFT.
  8.  *
  9.  * note: when making this prog under HCE remember to set the 'use' maths
  10.  *       library gadget in the linker-options window.
  11.  */
  12.  
  13. main()
  14. {
  15.  short  w;
  16.  int    i;
  17.  float  f;
  18.  double d;
  19.  
  20. /* Changed lines below slightly. VANSOFT. */
  21.  printf(
  22.   "\n\n\nscanf() and floating point test for the internal compiler HCC.\n");
  23.  printf(
  24.   "note: If run from 'HCE' click inside 'CLI' before you start typing!.\n\n");
  25.  
  26.  printf("Please enter an integer value that fits within 16 bit:\n");
  27.  scanf ("%hd", &w);
  28.  printf("scanf() returned %d\n\n", w);
  29.  
  30.  printf("Please enter an integer value that fits within 32 bit:\n");
  31.  
  32.  scanf ("%d", &i);
  33.  printf("scanf() returned %d\n\n", i);
  34.  
  35.  printf("Please enter a float value:\n");
  36.  scanf ("%f", &f);
  37.  printf("scanf() returned %f\n\n", f);
  38.  
  39.  printf("Please enter a double value:\n");
  40.  scanf ("%lf", &d);
  41.  printf("scanf() returned %lf\n\n", d);
  42.  
  43.  printf("Testing mathtrans function:\n");
  44.  printf("sin(Pi/2)=%f\n\n", sin(3.1415926/2));
  45.  
  46.  printf("Goodbye...\n\n\n");
  47. }
  48.