///////////////////////////////////////////////////////////////////////////
// FILE: limits (Definition of std::numeric_limits)
//
//                          Open Watcom Project
//
//    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
//
//    This file is automatically generated. Do not edit directly.
//
// =========================================================================
//
// Description: This header is part of the C++ standard library. It
//              defines the numeric_limits template and provides
//              specializations for all the built-in numeric types.
///////////////////////////////////////////////////////////////////////////
#ifndef _LIMITS_INCLUDED
#define _LIMITS_INCLUDED
#if !defined(_ENABLE_AUTODEPEND)
  #pragma read_only_file;
#endif


#ifndef __cplusplus
#error The header limits requires C++
#endif

#include <cfloat>
#include <climits>
#include <cstddef>

namespace std {

  enum float_round_style {
    round_indeterminate       = -1,
    round_toward_zero         =  0,
    round_to_nearest          =  1,
    round_toward_infinity     =  2,
    round_toward_neg_infinity =  3
  };

  enum float_denorm_style
    { denorm_present, denorm_absent, denorm_indeterminate };

  template< class Type >
  class numeric_limits {
  public:
    static const bool is_specialized = false;
    static Type min();
    static Type max();
    static const int digits = 0;
    static const int digits10 = 0;
    static const bool is_signed = false;
    static const bool is_integer = false;
    static const bool is_exact = false;
    static const int radix = 0;
    static Type epsilon();
    static Type round_error();
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static Type infinity();
    static Type quiet_NaN();
    static Type signaling_NaN();
    static Type denorm_min();
    static const bool is_iec559 = false;
    static const bool is_bounded = false;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // The required specializations

  // template< >
  class numeric_limits< bool > {
  public:
    static const bool is_specialized = true;
    static bool min() { return( 0 ); }
    static bool max() { return( 1 ); }
    static const int digits = 1;
    static const int digits10 = 0;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static bool epsilon() { return( 0 ); }
    static bool round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static bool infinity() { return( 0 ); }
    static bool quiet_NaN() { return( 0 ); }
    static bool signaling_NaN() { return( 0 ); }
    static bool denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< char > {
  public:
    static const bool is_specialized = true;
    static char min() { return( CHAR_MIN ); }
    static char max() { return( CHAR_MAX ); }
#ifdef __CHAR_SIGNED__
    static const int digits = 7;
    static const int digits10 = 2;
    static const bool is_signed = true;
#else
    static const int digits = 8;
    static const int digits10 = 2;
    static const bool is_signed = false;
#endif
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static char epsilon() { return( 0 ); }
    static char round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static char infinity() { return( 0 ); }
    static char quiet_NaN() { return( 0 ); }
    static char signaling_NaN() { return( 0 ); }
    static char denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< signed char > {
  public:
    static const bool is_specialized = true;
    static signed char min() { return( SCHAR_MIN ); }
    static signed char max() { return( SCHAR_MAX ); }
    static const int digits = 7;
    static const int digits10 = 2;
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static signed char epsilon() { return( 0 ); }
    static signed char round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static signed char infinity() { return( 0 ); }
    static signed char quiet_NaN() { return( 0 ); }
    static signed char signaling_NaN() { return( 0 ); }
    static signed char denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< unsigned char > {
  public:
    static const bool is_specialized = true;
    static unsigned char min() { return( 0 ); }
    static unsigned char max() { return( UCHAR_MAX ); }
    static const int digits = 8;
    static const int digits10 = 2;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static unsigned char epsilon() { return( 0 ); }
    static unsigned char round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static unsigned char infinity() { return( 0 ); }
    static unsigned char quiet_NaN() { return( 0 ); }
    static unsigned char signaling_NaN() { return( 0 ); }
    static unsigned char denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< wchar_t > {
  public:
    static const bool is_specialized = true;
    static wchar_t min() { return( 0 ); }
    static wchar_t max() { return( 65535U ); }
    static const int digits = 16;
    static const int digits10 = 4;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 0;
    static wchar_t epsilon() { return( 0 ); }
    static wchar_t round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static wchar_t infinity() { return( 0 ); }
    static wchar_t quiet_NaN() { return( 0 ); }
    static wchar_t signaling_NaN() { return( 0 ); }
    static wchar_t denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< short > {
  public:
    static const bool is_specialized = true;
    static short min() { return( SHRT_MIN ); }
    static short max() { return( SHRT_MAX ); }
    static const int digits = 15;
    static const int digits10 = 4;
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static short epsilon() { return( 0 ); }
    static short round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static short infinity() { return( 0 ); }
    static short quiet_NaN() { return( 0 ); }
    static short signaling_NaN() { return( 0 ); }
    static short denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< int > {
  public:
    static const bool is_specialized = true;
    static int min() { return( INT_MIN ); }
    static int max() { return( INT_MAX ); }
#if defined(__386__) || defined(__AXP__) || defined(__PPC__) || defined(__MIPS__)
    static const int digits = 31;
    static const int digits10 = 9;
#else
    static const int digits = 15;
    static const int digits10 = 4;
#endif
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static int epsilon() { return( 0 ); }
    static int round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static int infinity() { return( 0 ); }
    static int quiet_NaN() { return( 0 ); }
    static int signaling_NaN() { return( 0 ); }
    static int denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< long > {
  public:
    static const bool is_specialized = true;
    static long min() { return( LONG_MIN ); }
    static long max() { return( LONG_MAX ); }
    static const int digits = 31;
    static const int digits10 = 9;
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static long epsilon() { return( 0 ); }
    static long round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static long infinity() { return( 0 ); }
    static long quiet_NaN() { return( 0 ); }
    static long signaling_NaN() { return( 0 ); }
    static long denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

#ifdef __WATCOM_INT64__
  // template< >
  class numeric_limits< long long > {
  public:
    static const bool is_specialized = true;
    static long long min() { return( LLONG_MIN ); }
    static long long max() { return( LLONG_MAX ); }
    static const int digits = 63;
    static const int digits10 = 18;
    static const bool is_signed = true;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static long long epsilon() { return( 0 ); }
    static long long round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static long long infinity() { return( 0 ); }
    static long long quiet_NaN() { return( 0 ); }
    static long long signaling_NaN() { return( 0 ); }
    static long long denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };
#endif

  // template< >
  class numeric_limits< unsigned short > {
  public:
    static const bool is_specialized = true;
    static unsigned short min() { return( 0 ); }
    static unsigned short max() { return( USHRT_MAX ); }
    static const int digits = 16;
    static const int digits10 = 4;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static unsigned short epsilon() { return( 0 ); }
    static unsigned short round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static unsigned short infinity() { return( 0 ); }
    static unsigned short quiet_NaN() { return( 0 ); }
    static unsigned short signaling_NaN() { return( 0 ); }
    static unsigned short denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< unsigned int > {
  public:
    static const bool is_specialized = true;
    static unsigned int min() { return( 0 ); }
    static unsigned int max() { return( UINT_MAX ); }
#if defined(__386__) || defined(__AXP__) || defined(__PPC__) || defined(__MIPS__)
    static const int digits = 32;
    static const int digits10 = 9;
#else
    static const int digits = 16;
    static const int digits10 = 4;
#endif
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static unsigned int epsilon() { return( 0 ); }
    static unsigned int round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static unsigned int infinity() { return( 0 ); }
    static unsigned int quiet_NaN() { return( 0 ); }
    static unsigned int signaling_NaN() { return( 0 ); }
    static unsigned int denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

  // template< >
  class numeric_limits< unsigned long > {
  public:
    static const bool is_specialized = true;
    static unsigned long min() { return( 0 ); }
    static unsigned long max() { return( ULONG_MAX ); }
    static const int digits = 32;
    static const int digits10 = 9;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static unsigned long epsilon() { return( 0 ); }
    static unsigned long round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static unsigned long infinity() { return( 0 ); }
    static unsigned long quiet_NaN() { return( 0 ); }
    static unsigned long signaling_NaN() { return( 0 ); }
    static unsigned long denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };

#ifdef __WATCOM_INT64__
  // template< >
  class numeric_limits< unsigned long long > {
  public:
    static const bool is_specialized = true;
    static unsigned long long min() { return( 0 ); }
    static unsigned long long max() { return( ULLONG_MAX ); }
    static const int digits = 64;
    static const int digits10 = 19;
    static const bool is_signed = false;
    static const bool is_integer = true;
    static const bool is_exact = true;
    static const int radix = 2;
    static unsigned long long epsilon() { return( 0 ); }
    static unsigned long long round_error() { return( 0 ); }
    static const int min_exponent = 0;
    static const int min_exponent10 = 0;
    static const int max_exponent = 0;
    static const int max_exponent10 = 0;
    static const bool has_infinity = false;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_absent;
    static const bool has_denorm_loss = false;
    static unsigned long long infinity() { return( 0 ); }
    static unsigned long long quiet_NaN() { return( 0 ); }
    static unsigned long long signaling_NaN() { return( 0 ); }
    static unsigned long long denorm_min() { return( 0 ); }
    static const bool is_iec559 = false;
    static const bool is_bounded = true;
    static const bool is_modulo = true;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_toward_zero;
  };
#endif

  // template< >
  class numeric_limits< float > {
  public:
    static const bool is_specialized = true;
    static float min() { return( FLT_MIN ); }
    static float max() { return( FLT_MAX ); }
    static const int digits = FLT_MANT_DIG;
    static const int digits10 = FLT_DIG;
    static const bool is_signed = true;
    static const bool is_integer = false;
    static const bool is_exact = false;
    static const int radix = FLT_RADIX;
    static float epsilon() { return( FLT_EPSILON ); }
    static float round_error() { return( 0.5F ); }
    static const int min_exponent = FLT_MIN_EXP;
    static const int min_exponent10 = FLT_MIN_10_EXP;
    static const int max_exponent = FLT_MAX_EXP;
    static const int max_exponent10 = FLT_MAX_10_EXP;
    static const bool has_infinity = true;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_indeterminate;
    static const bool has_denorm_loss = false;
    static float infinity();
    static float quiet_NaN();
    static float signaling_NaN();
    static float denorm_min();
    static const bool is_iec559 = true;
    static const bool is_bounded = true;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_to_nearest;
  };

  // template< >
  class numeric_limits< double > {
  public:
    static const bool is_specialized = true;
    static double min() { return( DBL_MIN ); }
    static double max() { return( DBL_MAX ); }
    static const int digits = DBL_MANT_DIG;
    static const int digits10 = DBL_DIG;
    static const bool is_signed = true;
    static const bool is_integer = false;
    static const bool is_exact = false;
    static const int radix = _DBL_RADIX;
    static double epsilon() { return( DBL_EPSILON ); }
    static double round_error() { return( 0.5 ); }
    static const int min_exponent = DBL_MIN_EXP;
    static const int min_exponent10 = DBL_MIN_10_EXP;
    static const int max_exponent = DBL_MAX_EXP;
    static const int max_exponent10 = DBL_MAX_10_EXP;
    static const bool has_infinity = true;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_indeterminate;
    static const bool has_denorm_loss = false;
    static double infinity();
    static double quiet_NaN();
    static double signaling_NaN();
    static double denorm_min();
    static const bool is_iec559 = true;
    static const bool is_bounded = true;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_to_nearest;
  };

  // template< >
  class numeric_limits< long double > {
  public:
    static const bool is_specialized = true;
    static long double min() { return( LDBL_MIN ); }
    static long double max() { return( LDBL_MAX ); }
    static const int digits = LDBL_MANT_DIG;
    static const int digits10 = LDBL_DIG;
    static const bool is_signed = true;
    static const bool is_integer = false;
    static const bool is_exact = false;
    static const int radix = _LDBL_RADIX;
    static long double epsilon() { return( LDBL_EPSILON ); }
    static long double round_error() { return( 0.5L ); }
    static const int min_exponent = LDBL_MIN_EXP;
    static const int min_exponent10 = LDBL_MIN_10_EXP;
    static const int max_exponent = LDBL_MAX_EXP;
    static const int max_exponent10 = LDBL_MAX_10_EXP;
    static const bool has_infinity = true;
    static const bool has_quiet_NaN = false;
    static const bool has_signaling_NaN = false;
    static const float_denorm_style has_denorm = denorm_indeterminate;
    static const bool has_denorm_loss = false;
    static long double infinity();
    static long double quiet_NaN();
    static long double signaling_NaN();
    static long double denorm_min();
    static const bool is_iec559 = true;
    static const bool is_bounded = true;
    static const bool is_modulo = false;
    static const bool traps = false;
    static const bool tinyness_before = false;
    static const float_round_style round_style = round_to_nearest;
  };

} // namespace std
#endif
