home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / include / scaled-num.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-27  |  1.3 KB  |  39 lines

  1. /* scaled-num.h: declarations for ``scaled'' numbers, which are a 32-bit
  2.    word with 16 bits of fraction.
  3.  
  4. Copyright (C) 1992 Free Software Foundation, Inc.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #ifndef SCALED_NUM_H
  21. #define SCALED_NUM_H
  22.  
  23. #include "types.h"
  24.  
  25.  
  26. /* The type.  */
  27. typedef long scaled;
  28.  
  29. /* Print a scaled number, rounded to five digits.  */
  30. extern void print_scaled (scaled);
  31.  
  32. /* Conversions to and from C floating-point numbers.  The conversions
  33.    may not be exact, but since we use this to represent physical
  34.    quantities, a tiny loss of accuracy does not matter.  */
  35. extern const real scaled_to_real (scaled);
  36. extern const scaled real_to_scaled (real);
  37.  
  38. #endif /* not SCALED_NUM_H */
  39.