/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#pragma force_top_level
#pragma include_only_once

/* float.h: ISO 'C' (9899:2018) library header, section 5.2.4.2.2 */
/* Copyright (C) Codemist Ltd, 1988 */
/* Copyright (C) Acorn Computers Ltd. 1991, 1992 */
/* version 3.01 */

#ifndef __float_h
#define __float_h

#define FLT_RADIX     2
    /* radix of exponent representation */
#define FLT_ROUNDS    1
    /*
     * The rounding mode for floating-point addition is characterised by the
     * value of FLT_ROUNDS:
     *  -1 : indeterminable.
     *   0 : towards zero.
     *   1 : to nearest.
     *   2 : towards positive infinity.
     *   3 : towards negative infinity.
     *   ? : any other is implementation-defined.
     */
#define FLT_EVAL_METHOD 0
    /*
     * The value of operations with floating operands and values subject to the
     * usual arithmetic conversions and of floating constants are evaluated to
     * a format whose range and precision may be greater than required by the
     * type. The use of evaluation formats is characterised by the value of
     * FLT_EVAL_METHOD:
     *  -1 : indeterminable;
     *   0 : evaluate all operations and constants just to the range and
     *       precision of the type;
     *   1 : evaluate operations and constants of type float and double to the
     *       range of the double type, evaluate long double operations and
     *       constants to the range and precision of the long double type;
     *   2 : evaluate all operations and constants to the range and precision
     *       of the long double type;
     *   ? : all other negative values are implementation defined.
     */

#define FLT_HAS_SUBNORM     1
#define DBL_HAS_SUBNORM     1
#define LDBL_HAS_SUBNORM    1
    /*
     * The implementation's handling of subnormal numbers:
     *  -1 : indeterminable.
     *   0 : absent (type does not support subnormal numbers)
     *   1 : present (type does support subnormal numbers)
     */

#define FLT_MANT_DIG        24
#define DBL_MANT_DIG        53
#define LDBL_MANT_DIG       53
    /* number of base-FLT_RADIX digits in the floating point mantissa */

#define FLT_DECIMAL_DIG     9
#define DBL_DECIMAL_DIG     17
#define LDBL_DECIMAL_DIG    17
    /* number of decimal digits required to hold a floating-point number */
    /* accurately. */

#define DECIMAL_DIG  17
    /* number of decimal digits required to hold a floating-point number */
    /* accurately in the widest supported type. */

#define FLT_DIG      6
#define DBL_DIG      15
#define LDBL_DIG     15
    /* number of decimal digits of precision */

#define FLT_MIN_EXP  (-125)
#define DBL_MIN_EXP  (-1021)
#define LDBL_MIN_EXP (-1021)
    /* minimum negative integer such that FLT_RADIX raised to that power */
    /* minus 1 is a normalised floating-point number. */

#define FLT_MIN_10_EXP  (-37)
#define DBL_MIN_10_EXP  (-307)
#define LDBL_MIN_10_EXP (-307)
    /* minimum negative integer such that 10 raised to that power is in the */
    /* range of normalised floating-point numbers. */

#define FLT_MAX_EXP  128
#define DBL_MAX_EXP  1024
#define LDBL_MAX_EXP 1024
    /* maximum integer such that FLT_RADIX raised to that power minus 1 is a */
    /* representable finite floating-point number. */

#define FLT_MAX_10_EXP  38
#define DBL_MAX_10_EXP  308
#define LDBL_MAX_10_EXP 308
    /* maximum integer such that 10 raised to that power is in the range of */
    /* representable finite floating-point numbers. */

#define FLT_MAX  3.40282347e+38F
#define DBL_MAX  1.79769313486231571e+308
#define LDBL_MAX 1.79769313486231571e+308L
    /* maximum representable finite floating-point number. */

#define FLT_EPSILON         1.19209290e-7F
#define DBL_EPSILON         2.2204460492503131e-16
#define LDBL_EPSILON        2.2204460492503131e-16L
    /* minimum positive floating point number x such that 1.0 + x != 1.0 */

#define FLT_MIN  1.17549435e-38F
#define DBL_MIN  2.22507385850720138e-308
#define LDBL_MIN 2.22507385850720138e-308L
    /* minimum normalised positive floating-point number. */

#define FLT_TRUE_MIN  1.40129846e-45F
#define DBL_TRUE_MIN  4.94065645841246544e-324
#define LDBL_TRUE_MIN 4.94065645841246544e-324L
    /* minimum positive floating-point number. */

#endif

/* end of float.h */
