home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue4 / SDL / gcc346 / !gcc / include / libscl / h / float < prev    next >
Encoding:
Text File  |  2006-09-17  |  5.1 KB  |  136 lines

  1. /* float.h standard header for the RISC OS SharedCLibrary.
  2.    Copyright (c) 1997-2005 Nick Burrett
  3.    All rights reserved.
  4.  
  5.    Redistribution and use in source and binary forms, with or without
  6.    modification, are permitted provided that the following conditions
  7.    are met:
  8.    1. Redistributions of source code must retain the above copyright
  9.       notice, this list of conditions and the following disclaimer.
  10.    2. Redistributions in binary form must reproduce the above copyright
  11.       notice, this list of conditions and the following disclaimer in the
  12.       documentation and/or other materials provided with the distribution.
  13.    3. The name of the author may not be used to endorse or promote products
  14.       derived from this software without specific prior written permission.
  15.  
  16.    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  17.    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  18.    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  19.    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  20.    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  21.    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22.    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23.    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24.    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  25.    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  26.  
  27. #ifndef __FLOAT_H
  28. #define __FLOAT_H
  29.  
  30. /* Value of the base, or radix, of exponent representation.  */
  31. #define FLT_RADIX 2
  32.  
  33. /* Characterizes the rounding mode for floating point addition.
  34.    -1 = the mode is indeterminable.
  35.    0 = rounding is towards zero.
  36.    1 = rounding is to the nearest number.
  37.    2 = rounding is towards positive infinity. */
  38. #define FLT_ROUNDS 1
  39.  
  40. /* Number of base-'FLT_RADIX' digits in the floating point mantissa
  41.    for the float data type.  */
  42. #define FLT_MANT_DIG 24
  43.  
  44. /* Number of base-'FLT_RADIX' digits in the floating point mantissa
  45.    for the double data type.  */
  46. #define DBL_MANT_DIG 53
  47.  
  48. /* Number of base-'FLT_RADIX' digits in the floating point mantissa
  49.    for the long double data type.  */
  50. #define LDBL_MANT_DIG 53
  51.  
  52. /* Number of decimal digits of precision for the float data type.  */
  53. #define FLT_DIG 6
  54.  
  55. /* Number of decimal digits of precision for the double data type.  */
  56. #define DBL_DIG 15
  57.  
  58. /* Number of decimal digits of precision for the long double data type.  */
  59. #define LDBL_DIG 15
  60.  
  61. /* Smallest possible exponent value for type float.  */
  62. #define FLT_MIN_EXP (-125)
  63.  
  64. /* Smallest possible exponent value for type double.  */
  65. #define DBL_MIN_EXP (-1021)
  66.  
  67. /* Smallest possible exponent value for type long double.  */
  68. #define LDBL_MIN_EXP (-1021)
  69.  
  70. /* Minimum negative integer such that 10 raised to this power
  71.    minus 1 can be represented as a normalized floating point
  72.    number of type float.  */
  73. #define FLT_MIN_10_EXP (-37)
  74.  
  75. /* Minimum negative integer such that 10 raised to this power
  76.    minus 1 can be represented as a normalized floating point
  77.    number of type double.  */
  78. #define DBL_MIN_10_EXP (-307)
  79.  
  80. /* Minimum negative integer such that 10 raised to this power
  81.    minus 1 can be represented as a normalized floating point
  82.    number of type long double.  */
  83. #define LDBL_MIN_10_EXP (-307)
  84.  
  85. /* Largest possible exponent value for type float.  */
  86. #define FLT_MAX_EXP 128
  87.  
  88. /* Largest possible exponent value for type double.  */
  89. #define DBL_MAX_EXP 1024
  90.  
  91. /* Largest possible exponent value for type long double.  */
  92. #define LDBL_MAX_EXP 1024
  93.  
  94. /* Maximum positive integer such that 10 raised to this power
  95.    minus 1 can be represented as a normalized floating point
  96.    number of type long double.  */
  97. #define FLT_MAX_10_EXP 38
  98.  
  99. /* Maximum positive integer such that 10 raised to this power
  100.    minus 1 can be represented as a normalized floating point
  101.    number of type long double.  */
  102. #define DBL_MAX_10_EXP 308
  103.  
  104. /* Maximum positive integer such that 10 raised to this power
  105.    minus 1 can be represented as a normalized floating point
  106.    number of type long double.  */
  107. #define LDBL_MAX_10_EXP 308
  108.  
  109. /* Maximum number representable in type float.  */
  110. #define FLT_MAX 3.40282347e+38F
  111. /* Maximum number representable in type double.  */
  112. #define DBL_MAX 1.79769313486231571e+308
  113. /* Maximum number representable in type long double.  */
  114. #define LDBL_MAX 1.79769313486231571e+308L
  115.  
  116. /* Minimum positive floating point number of type float
  117.    such that '1.0 + FLT_EPSILON != 1.0' is true.  */
  118. #define FLT_EPSILON 1.19209290e-7F
  119.  
  120. /* Minimum positive floating point number of type double
  121.    such that '1.0 + DBL_EPSILON != 1.0' is true.  */
  122. #define DBL_EPSILON 2.2204460492503131e-16
  123.  
  124. /* Minimum positive floating point number of type long double
  125.    such that '1.0 + DBL_EPSILON != 1.0' is true.  */
  126. #define LDBL_EPSILON 2.2204460492503131e-16L
  127.  
  128. /* Minimum number representable in type float.  */
  129. #define FLT_MIN 1.17549435e-38F
  130. /* Minimum number representable in type double.  */
  131. #define DBL_MIN 2.22507385850720138e-308
  132. /* Minimum number representable in type long double.  */
  133. #define LDBL_MIN 2.22507385850720138e-308L
  134.  
  135. #endif
  136.