File Index Symbol Index

// limits standard header
#pragma once
#ifndef _LIMITS_
#define _LIMITS_
#ifndef RC_INVOKED #include <ymath.h> #include <cfloat> #include <climits> #include <cmath> #include <cwchar>
#include <xstddef>
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new
// ENUM float_denorm_style
enum
float_denorm_style
{
// constants for different IEEE float denormalization styles
denorm_indeterminate
= -
1
,
denorm_absent
=
0
,
denorm_present
=
1
};
// ENUM float_round_style
enum
float_round_style
{
// constants for different IEEE rounding styles
round_indeterminate
= -
1
,
round_toward_zero
=
0
,
round_to_nearest
=
1
,
round_toward_infinity
=
2
,
round_toward_neg_infinity
=
3
};
// STRUCT _Num_base
struct
_Num_base
{
// base for all types, with common defaults
static
constexpr
float_denorm_style
has_denorm
=
denorm_absent
;
static
constexpr
bool
has_denorm_loss
=
false
;
static
constexpr
bool
has_infinity
=
false
;
static
constexpr
bool
has_quiet_NaN
=
false
;
static
constexpr
bool
has_signaling_NaN
=
false
;
static
constexpr
bool
is_bounded
=
false
;
static
constexpr
bool
is_exact
=
false
;
static
constexpr
bool
is_iec559
=
false
;
static
constexpr
bool
is_integer
=
false
;
static
constexpr
bool
is_modulo
=
false
;
static
constexpr
bool
is_signed
=
false
;
static
constexpr
bool
is_specialized
=
false
;
static
constexpr
bool
tinyness_before
=
false
;
static
constexpr
bool
traps
=
false
;
static
constexpr
float_round_style
round_style
=
round_toward_zero
;
static
constexpr
int
digits
=
0
;
static
constexpr
int
digits10
=
0
;
static
constexpr
int
max_digits10
=
0
;
static
constexpr
int
max_exponent
=
0
;
static
constexpr
int
max_exponent10
=
0
;
static
constexpr
int
min_exponent
=
0
;
static
constexpr
int
min_exponent10
=
0
;
static
constexpr
int
radix
=
0
; };
// CLASS TEMPLATE numeric_limits
template
<
class
_Ty
>
class
numeric_limits
:
public
_Num_base
{
// numeric limits for arbitrary type _Ty (say little or nothing)
public
: {
// return minimum value
return
(
_Ty
()); } {
// return maximum value
return
(
_Ty
()); } {
// return most negative value
return
(
_Ty
()); } {
// return smallest effective increment from 1.0
return
(
_Ty
()); } {
// return largest rounding error
return
(
_Ty
()); } {
// return minimum denormalized value
return
(
_Ty
()); } {
// return positive infinity
return
(
_Ty
()); } {
// return non-signaling NaN
return
(
_Ty
()); } {
// return signaling NaN
return
(
_Ty
()); } };
template
<
class
_Ty
>
class
numeric_limits
<
const
_Ty
> :
public
numeric_limits
<
_Ty
> {
// numeric limits for const types
};
template
<
class
_Ty
>
class
numeric_limits
<
volatile
_Ty
> :
public
numeric_limits
<
_Ty
> {
// numeric limits for volatile types
};
template
<
class
_Ty
>
class
numeric_limits
<
const
volatile
_Ty
> :
public
numeric_limits
<
_Ty
> {
// numeric limits for const volatile types
};
// STRUCT _Num_int_base
struct
_Num_int_base
:
_Num_base
{
// base for integer types
static
constexpr
bool
is_bounded
=
true
;
static
constexpr
bool
is_exact
=
true
;
static
constexpr
bool
is_integer
=
true
;
static
constexpr
bool
is_specialized
=
true
;
static
constexpr
int
radix
=
2
; };
// STRUCT _Num_float_base
struct
_Num_float_base
:
_Num_base
{
// base for floating-point types
static
constexpr
float_denorm_style
has_denorm
=
denorm_present
;
static
constexpr
bool
has_infinity
=
true
;
static
constexpr
bool
has_quiet_NaN
=
true
;
static
constexpr
bool
has_signaling_NaN
=
true
;
static
constexpr
bool
is_bounded
=
true
;
static
constexpr
bool
is_iec559
=
true
;
static
constexpr
bool
is_signed
=
true
;
static
constexpr
bool
is_specialized
=
true
;
static
constexpr
float_round_style
round_style
=
round_to_nearest
; };
// CLASS numeric_limits<char>
template
<>
class
numeric_limits
<
char
> :
public
_Num_int_base
{
// limits for type char
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
int
digits10
=
2
; };
// CLASS numeric_limits<wchar_t>
template
<>
class
numeric_limits
<
wchar_t
> :
public
_Num_int_base
{
// limits for type wchar_t
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
16
;
static
constexpr
int
digits10
=
4
; };
// CLASS numeric_limits<bool>
template
<>
class
numeric_limits
<
bool
> :
public
_Num_int_base
{
// limits for type bool
public
: {
// return minimum value
return
(
false
); } {
// return maximum value
return
(
true
); } {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
int
digits
=
1
; };
// CLASS numeric_limits<signed char>
template
<>
class
numeric_limits
<
signed
char
> :
public
_Num_int_base
{
// limits for type signed char
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_signed
=
true
;
static
constexpr
int
digits
=
7
;
static
constexpr
int
digits10
=
2
; };
// CLASS numeric_limits<unsigned char>
template
<>
class
numeric_limits
<
unsigned
char
> :
public
_Num_int_base
{
// limits for type unsigned char
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
8
;
static
constexpr
int
digits10
=
2
; };
// CLASS numeric_limits<short>
template
<>
class
numeric_limits
<
short
> :
public
_Num_int_base
{
// limits for type short
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_signed
=
true
;
static
constexpr
int
digits
=
15
;
static
constexpr
int
digits10
=
4
; };
#ifdef _NATIVE_WCHAR_T_DEFINED
// CLASS numeric_limits<unsigned short>
template
<>
class
numeric_limits
<
unsigned
short
> :
public
_Num_int_base
{
// limits for type unsigned short
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
16
;
static
constexpr
int
digits10
=
4
; };
#endif /* _NATIVE_WCHAR_T_DEFINED */
// CLASS numeric_limits<char16_t>
template
<>
class
numeric_limits
<
char16_t
> :
public
_Num_int_base
{
// limits for type char16_t
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
16
;
static
constexpr
int
digits10
=
4
; };
// CLASS numeric_limits<int>
template
<>
class
numeric_limits
<
int
> :
public
_Num_int_base
{
// limits for type int
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_signed
=
true
;
static
constexpr
int
digits
=
31
;
static
constexpr
int
digits10
=
9
; };
// CLASS numeric_limits<unsigned int>
template
<>
class
numeric_limits
<
unsigned
int
> :
public
_Num_int_base
{
// limits for type unsigned int
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
32
;
static
constexpr
int
digits10
=
9
; };
// CLASS numeric_limits<long>
template
<>
class
numeric_limits
<
long
> :
public
_Num_int_base
{
// limits for type long
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static_assert
(
sizeof
(
int
)
=
=
sizeof
(
long
),
"LLP64 assumption"
);
static
constexpr
bool
is_signed
=
true
;
static
constexpr
int
digits
=
31
;
static
constexpr
int
digits10
=
9
; };
// CLASS numeric_limits<unsigned long>
template
<>
class
numeric_limits
<
unsigned
long
> :
public
_Num_int_base
{
// limits for type unsigned long
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static_assert
(
sizeof
(
unsigned
int
)
=
=
sizeof
(
unsigned
long
),
"LLP64 assumption"
);
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
32
;
static
constexpr
int
digits10
=
9
; };
// CLASS numeric_limits<char32_t>
template
<>
class
numeric_limits
<
char32_t
> :
public
_Num_int_base
{
// limits for type char32_t
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
32
;
static
constexpr
int
digits10
=
9
; };
// CLASS numeric_limits<long long>
template
<>
class
numeric_limits
<
long
long
> :
public
_Num_int_base
{
// limits for type long long
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_signed
=
true
;
static
constexpr
int
digits
=
63
;
static
constexpr
int
digits10
=
18
; };
// CLASS numeric_limits<unsigned long long>
template
<>
class
numeric_limits
<
unsigned
long
long
> :
public
_Num_int_base
{
// limits for type unsigned long long
public
: {
// return minimum value
return
(
0
); } {
// return maximum value
} {
// return most negative value
return
((
min
)()); } {
// return smallest effective increment from 1.0
return
(
0
); } {
// return largest rounding error
return
(
0
); } {
// return minimum denormalized value
return
(
0
); } {
// return positive infinity
return
(
0
); } {
// return non-signaling NaN
return
(
0
); } {
// return signaling NaN
return
(
0
); }
static
constexpr
bool
is_modulo
=
true
;
static
constexpr
int
digits
=
64
;
static
constexpr
int
digits10
=
19
; };
// CLASS numeric_limits<float>
template
<>
class
numeric_limits
<
float
> :
public
_Num_float_base
{
// limits for type float
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
(-(
max
)()); } {
// return smallest effective increment from 1.0
} {
// return largest rounding error
return
(
0.5F
); } {
// return minimum denormalized value
} {
// return positive infinity
return
(__builtin_huge_valf()); } {
// return non-signaling NaN
return
(__builtin_nanf(
"0"
)); } {
// return signaling NaN
return
(__builtin_nansf(
"1"
)); }
static
constexpr
int
max_digits10
=
9
; };
// CLASS numeric_limits<double>
template
<>
class
numeric_limits
<
double
> :
public
_Num_float_base
{
// limits for type double
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
(-(
max
)()); } {
// return smallest effective increment from 1.0
} {
// return largest rounding error
return
(
0.5
); } {
// return minimum denormalized value
} {
// return positive infinity
return
(__builtin_huge_val()); } {
// return non-signaling NaN
return
(__builtin_nan(
"0"
)); } {
// return signaling NaN
return
(__builtin_nans(
"1"
)); }
static
constexpr
int
max_digits10
=
17
; };
// CLASS numeric_limits<long double>
template
<>
class
numeric_limits
<
long
double
> :
public
_Num_float_base
{
// limits for type long double
public
: {
// return minimum value
} {
// return maximum value
} {
// return most negative value
return
(-(
max
)()); } {
// return smallest effective increment from 1.0
} {
// return largest rounding error
return
(
0.5L
); } {
// return minimum denormalized value
} {
// return positive infinity
return
(__builtin_huge_val()); } {
// return non-signaling NaN
return
(__builtin_nan(
"0"
)); } {
// return signaling NaN
return
(__builtin_nans(
"1"
)); }
static
constexpr
int
max_digits10
=
17
; };
#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
/* * Copyright (c) by P.J. Plauger. All rights reserved. * Consult your license regarding permissions and restrictions. V6.50:0009 */