home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 3 / AACD03.BIN / AACD / Programming / sofa / archive / SmallEiffel.lha / SmallEiffel / lib_std / platform.e < prev    next >
Text File  |  1999-06-05  |  3KB  |  122 lines

  1. -- This file is  free  software, which  comes  along  with  SmallEiffel. This
  2. -- software  is  distributed  in the hope that it will be useful, but WITHOUT 
  3. -- ANY  WARRANTY;  without  even  the  implied warranty of MERCHANTABILITY or
  4. -- FITNESS  FOR A PARTICULAR PURPOSE. You can modify it as you want, provided
  5. -- this header is kept unaltered, and a notification of the changes is added.
  6. -- You  are  allowed  to  redistribute  it and sell it, alone or as a part of 
  7. -- another product.
  8. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  9. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  10. --                       http://SmallEiffel.loria.fr
  11. --
  12. class PLATFORM
  13.  
  14. inherit GENERAL;
  15.    
  16. feature -- Maximum :
  17.  
  18.    Maximum_character_code : INTEGER is
  19.          -- Largest supported code for CHARACTER values.
  20.       external "SmallEiffel"
  21.       ensure
  22.          meaningful: Result >= 127
  23.       end;
  24.  
  25.    Maximum_integer: INTEGER is
  26.          -- Largest supported value of type INTEGER.
  27.       external "SmallEiffel"
  28.       ensure
  29.          meaningful: Result >= 0
  30.       end;
  31.  
  32.    Maximum_real: REAL is
  33.          -- Largest supported value of type REAL.
  34.       external "SmallEiffel"
  35.       ensure
  36.          meaningful: Result >= 0.0
  37.       end;
  38.  
  39.    Maximum_double: DOUBLE is
  40.          -- Largest supported value of type DOUBLE.
  41.       external "SmallEiffel"
  42.       ensure
  43.          meaningful: Result >= Maximum_real
  44.       end;
  45.  
  46. feature -- Minimum :
  47.  
  48.    Minimum_character_code: INTEGER is
  49.          -- Smallest supported code for CHARACTER values.
  50.       external "SmallEiffel"
  51.       ensure
  52.          meaningful: Result <= 0
  53.       end;
  54.    
  55.    Minimum_integer: INTEGER is
  56.          -- Smallest supported value of type INTEGER.
  57.       external "SmallEiffel"
  58.       ensure
  59.          meaningful: Result <= 0
  60.       end;
  61.  
  62.    Minimum_double: DOUBLE is
  63.          -- Smallest supported value of type DOUBLE.
  64.       external "SmallEiffel"
  65.       ensure
  66.          meaningful: Result <= 0.0
  67.       end;
  68.  
  69.    Minimum_real: REAL is
  70.          -- Smallest supported value of type REAL.
  71.       external "SmallEiffel"
  72.       ensure
  73.          meaningful: Result <= 0.0
  74.       end;
  75.  
  76. feature -- Bits :
  77.  
  78.    Boolean_bits: INTEGER is
  79.          -- Number of bits in a value of type BOOLEAN.
  80.       external "SmallEiffel"
  81.       ensure
  82.          meaningful: Result >= 1
  83.       end;
  84.  
  85.    Character_bits: INTEGER is
  86.          -- Number of bits in a value of type CHARACTER.
  87.       external "SmallEiffel"
  88.       ensure
  89.          meaningful: Result >= 1;
  90.          large_enough: (2^Result) >= Maximum_character_code;
  91.       end;
  92.  
  93.    Integer_bits: INTEGER is
  94.          -- Number of bits in a value of type INTEGER.
  95.       external "SmallEiffel"
  96.       ensure
  97.          meaningful: Result >= 1;
  98.       end;
  99.    
  100.    Real_bits: INTEGER is
  101.          -- Number of bits in a value of type REAL.
  102.       external "SmallEiffel"
  103.       ensure
  104.          meaningful: Result >= 1
  105.       end;
  106.  
  107.    Double_bits: INTEGER is
  108.          -- Number of bits in a value of type DOUBLE.
  109.       external "SmallEiffel"
  110.       ensure
  111.          meaningful: Result >= 1;
  112.          meaningful: Result >= Real_bits
  113.       end;
  114.  
  115.    Pointer_bits: INTEGER is
  116.          -- Number of bits in a value of type POINTER.
  117.       external "SmallEiffel"
  118.       end;
  119.  
  120. end -- PLATFORM
  121.  
  122.