Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gen-num-limits.cc File Reference

#include <bits/c++config.h>
#include <limits.h>
#include <float.h>
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <math.h>

Include dependency graph for gen-num-limits.cc:

Include dependency graph

Go to the source code of this file.

Compounds

struct  declarator
struct  division_by_zero
struct  infinity_trait
struct  overflow
struct  predicate
struct  type_name_trait
struct  type_trait
struct  underflow
struct  value

Defines

#define sigjmp_buf   jmp_buf
#define sigsetjmp(buf, save)   setjmp (buf)
#define siglongjmp(env, ret)   longjmp (env, ret)
#define SPECIALIZE_TRAPPING(T)
#define DEFINED_TYPE_NAME(T)
#define SPECIALIZE_EXACTNESS(T)
#define SPECIALIZE_IEC559(T)
#define DEFINE_EXTREMA(T, m, M)   DO_DEFINE_EXTREMA(T, m, M)
#define DO_DEFINE_EXTREMA(T, m, M)
#define SPECIALIZE_DIGITS(T, D, D10)
#define SPECIALIZE_RADIX(T, R)   const int value< T >::radix = R
#define SPECIALIZE_EPSILON(T, E)   DO_SPECIALIZE_EPSILON(T, E)
#define DO_SPECIALIZE_EPSILON(T, E)   const char value< T >::epsilon[] = #E
#define SPECIALIZE_ROUND_ERROR(T, R)   const char value< T >::round_error[] = #R
#define SPECIALIZE_EXPONENTS(T, m, m10, M, M10)
#define INSTANTIATIONS(TYPE)

Functions

void (*)(int) signal_adapter (signal_handler_type(*signal_func)(signal_number_type, signal_handler_type), signal_number_type arg, void(*handler)(int))
void signal_handler (int sig)
bool trapping (const Operation &op)
void traps ()
 SPECIALIZE_TRAPPING (unsigned char)
 DEFINED_TYPE_NAME (bool)
 DEFINED_TYPE_NAME (char)
 DEFINED_TYPE_NAME (signed char)
 DEFINED_TYPE_NAME (unsigned char)
 DEFINED_TYPE_NAME (wchar_t)
 DEFINED_TYPE_NAME (short)
 DEFINED_TYPE_NAME (int)
 DEFINED_TYPE_NAME (long)
 DEFINED_TYPE_NAME (float)
 DEFINED_TYPE_NAME (double)
 SPECIALIZE_EXACTNESS (float)
 SPECIALIZE_EXACTNESS (double)
 SPECIALIZE_EXACTNESS (long double)
 SPECIALIZE_IEC559 (bool)
 SPECIALIZE_IEC559 (int)
 SPECIALIZE_IEC559 (unsigned int)
 SPECIALIZE_IEC559 (long)
 DEFINE_EXTREMA (bool, false, true)
 DEFINE_EXTREMA (char, CHAR_MIN, CHAR_MAX)
 DEFINE_EXTREMA (signed char, SCHAR_MIN, SCHAR_MAX)
 DEFINE_EXTREMA (unsigned char, 0, UCHAR_MAX)
 DEFINE_EXTREMA (short, SHRT_MIN, SHRT_MAX)
 DEFINE_EXTREMA (int, INT_MIN, INT_MAX)
 DEFINE_EXTREMA (long, LONG_MIN, LONG_MAX)
 DEFINE_EXTREMA (float, FLT_MIN, FLT_MAX)
 DEFINE_EXTREMA (double, DBL_MIN, DBL_MAX)
 SPECIALIZE_DIGITS (float, FLT_MANT_DIG, FLT_DIG)
 SPECIALIZE_DIGITS (double, DBL_MANT_DIG, DBL_DIG)
 SPECIALIZE_DIGITS (long double, LDBL_MANT_DIG, LDBL_DIG)
 SPECIALIZE_RADIX (float, FLT_RADIX)
 SPECIALIZE_RADIX (double, FLT_RADIX)
 SPECIALIZE_RADIX (long double, FLT_RADIX)
 SPECIALIZE_EPSILON (bool, 0)
 SPECIALIZE_EPSILON (char, 0)
 SPECIALIZE_EPSILON (unsigned char, 0)
 SPECIALIZE_EPSILON (signed char, 0)
 SPECIALIZE_EPSILON (wchar_t, 0)
 SPECIALIZE_EPSILON (short, 0)
 SPECIALIZE_EPSILON (int, 0)
 SPECIALIZE_EPSILON (long, 0)
 SPECIALIZE_EPSILON (float, FLT_EPSILON)
 SPECIALIZE_EPSILON (double, DBL_EPSILON)
 SPECIALIZE_EPSILON (long double, LDBL_EPSILON)
 SPECIALIZE_ROUND_ERROR (bool, 0)
 SPECIALIZE_ROUND_ERROR (char, 0)
 SPECIALIZE_ROUND_ERROR (unsigned char, 0)
 SPECIALIZE_ROUND_ERROR (signed char, 0)
 SPECIALIZE_ROUND_ERROR (wchar_t, 0)
 SPECIALIZE_ROUND_ERROR (short, 0)
 SPECIALIZE_ROUND_ERROR (int, 0)
 SPECIALIZE_ROUND_ERROR (long, 0)
 SPECIALIZE_ROUND_ERROR (float, 1.0f)
 SPECIALIZE_ROUND_ERROR (double, 1.0)
 SPECIALIZE_ROUND_ERROR (long double, 1.0L)
 SPECIALIZE_EXPONENTS (float, FLT_MIN_EXP, FLT_MIN_10_EXP, FLT_MAX_EXP, FLT_MAX_10_EXP)
 SPECIALIZE_EXPONENTS (double, DBL_MIN_EXP, DBL_MIN_10_EXP, DBL_MAX_EXP, DBL_MAX_10_EXP)
 SPECIALIZE_EXPONENTS (long double, LDBL_MIN_EXP, LDBL_MIN_10_EXP, LDBL_MAX_EXP, LDBL_MAX_10_EXP)
void is_signed ()
void is_modulo ()
void min ()
void max ()
void is_integer ()
void is_exact ()
void digits ()
void digits10 ()
void radix ()
void epsilon ()
void round_error ()
void min_exponent ()
void min_exponent10 ()
void max_exponent ()
void max_exponent10 ()
void has_infinity ()
void has_quiet_nan ()
void has_signaling_nan ()
void has_denorm_loss ()
void is_iec559 ()
void tinyness_before ()
void round_style ()
int main ()
 INSTANTIATIONS (bool)
 INSTANTIATIONS (char)
 INSTANTIATIONS (signed char)
 INSTANTIATIONS (unsigned char)
 INSTANTIATIONS (short)
 INSTANTIATIONS (int)
 INSTANTIATIONS (long)
 INSTANTIATIONS (float)
 INSTANTIATIONS (double)

Variables

const char tab [] = " "
const char tab2 [] = " "
const char* bool_alpha [] = { "false", "true" }
const double log10_of_two = .30102999566398119
const int bits_per_byte = CHAR_BIT
const int integer_base_rep = 2
sigjmp_buf env


Define Documentation

#define DEFINED_TYPE_NAME( T )
 

Value:

const char type_name_trait< T >::type_name[] = #T;                      \
const char type_name_trait< T >::trait_name[] = "numeric_limits<" #T ">";

Definition at line 218 of file gen-num-limits.cc.

#define DEFINE_EXTREMA( T, m, M )   DO_DEFINE_EXTREMA(T, m, M)
 

Definition at line 360 of file gen-num-limits.cc.

#define DO_DEFINE_EXTREMA( T, m, M )
 

Value:

const char value< T >::min[] = #m;                  \
const char value< T >::max[] = #M

Definition at line 361 of file gen-num-limits.cc.

#define DO_SPECIALIZE_EPSILON( T, E )   const char value< T >::epsilon[] = #E
 

Definition at line 431 of file gen-num-limits.cc.

#define INSTANTIATIONS( TYPE )
 

Value:

  template struct predicate<TYPE>;      \
  template struct value<TYPE>

Definition at line 816 of file gen-num-limits.cc.

#define SPECIALIZE_DIGITS( T, D, D10 )
 

Value:

const int value< T >::digits = D;                   \
const int value< T >::digits10 = D10

Definition at line 399 of file gen-num-limits.cc.

#define SPECIALIZE_EPSILON( T, E )   DO_SPECIALIZE_EPSILON(T, E)
 

Definition at line 430 of file gen-num-limits.cc.

#define SPECIALIZE_EXACTNESS( T )
 

Value:

const bool predicate< T >::is_integer = false;              \
const bool predicate< T >::is_exact = false

Definition at line 291 of file gen-num-limits.cc.

#define SPECIALIZE_EXPONENTS( T, m, m10, M, M10 )
 

Value:

const int value< T >::min_exponent = m;                 \
const int value< T >::min_exponent10 = m10;             \
const int value< T >::max_exponent = M;                 \
const int value< T >::max_exponent10 = M10

Definition at line 507 of file gen-num-limits.cc.

#define SPECIALIZE_IEC559( T )
 

Value:

const bool predicate< T >::is_iec559 = true

Definition at line 323 of file gen-num-limits.cc.

#define SPECIALIZE_RADIX( T, R )   const int value< T >::radix = R
 

Definition at line 410 of file gen-num-limits.cc.

#define SPECIALIZE_ROUND_ERROR( T, R )   const char value< T >::round_error[] = #R
 

Definition at line 470 of file gen-num-limits.cc.

#define SPECIALIZE_TRAPPING( T )
 

Value:

template<> void traps< T >()                                            \
{                                       \
  fflush(NULL);                                                         \
  signal_adapter (signal, SIGFPE, signal_handler);                      \
  signal_adapter (signal, SIGTRAP, signal_handler);                     \
  const char* p = bool_alpha[trapping(division_by_zero<T>())];          \
  printf("%s%s = %s;\n", tab2, "static const bool traps", p);           \
}

Definition at line 191 of file gen-num-limits.cc.

#define sigjmp_buf   jmp_buf
 

Definition at line 72 of file gen-num-limits.cc.

#define siglongjmp( env, ret )   longjmp (env, ret)
 

Definition at line 74 of file gen-num-limits.cc.

Referenced by signal_handler().

#define sigsetjmp( buf, save )   setjmp (buf)
 

Definition at line 73 of file gen-num-limits.cc.

Referenced by trapping().


Function Documentation

DEFINED_TYPE_NAME ( double )
 

DEFINED_TYPE_NAME ( float )
 

DEFINED_TYPE_NAME ( long double )
 

DEFINED_TYPE_NAME ( int )
 

DEFINED_TYPE_NAME ( short )
 

DEFINED_TYPE_NAME ( wchar_t )
 

DEFINED_TYPE_NAME ( unsigned long )
 

DEFINED_TYPE_NAME ( signed char )
 

DEFINED_TYPE_NAME ( char )
 

DEFINED_TYPE_NAME ( bool )
 

DEFINE_EXTREMA ( double,
DBL_MIN,
DBL_MAX )
 

DEFINE_EXTREMA ( float,
FLT_MIN,
FLT_MAX )
 

DEFINE_EXTREMA ( long double,
LONG_MIN,
LONG_MAX )
 

DEFINE_EXTREMA ( int,
INT_MIN,
INT_MAX )
 

DEFINE_EXTREMA ( short,
SHRT_MIN,
SHRT_MAX )
 

DEFINE_EXTREMA ( unsigned long,
0,
UCHAR_MAX )
 

DEFINE_EXTREMA ( signed char,
SCHAR_MIN,
SCHAR_MAX )
 

DEFINE_EXTREMA ( char,
CHAR_MIN,
CHAR_MAX )
 

DEFINE_EXTREMA ( bool,
false,
true )
 

INSTANTIATIONS ( double )
 

INSTANTIATIONS ( float )
 

INSTANTIATIONS ( long double )
 

INSTANTIATIONS ( int )
 

INSTANTIATIONS ( short )
 

INSTANTIATIONS ( unsigned long )
 

INSTANTIATIONS ( signed char )
 

INSTANTIATIONS ( char )
 

INSTANTIATIONS ( bool )
 

SPECIALIZE_DIGITS ( long double,
LDBL_MANT_DIG,
LDBL_DIG )
 

SPECIALIZE_DIGITS ( double,
DBL_MANT_DIG,
DBL_DIG )
 

SPECIALIZE_DIGITS ( float,
FLT_MANT_DIG,
FLT_DIG )
 

SPECIALIZE_EPSILON ( long double,
LDBL_EPSILON )
 

SPECIALIZE_EPSILON ( double,
DBL_EPSILON )
 

SPECIALIZE_EPSILON ( float,
FLT_EPSILON )
 

SPECIALIZE_EPSILON ( long long,
0 )
 

SPECIALIZE_EPSILON ( int,
0 )
 

SPECIALIZE_EPSILON ( short,
0 )
 

SPECIALIZE_EPSILON ( wchar_t,
0 )
 

SPECIALIZE_EPSILON ( signed char,
0 )
 

SPECIALIZE_EPSILON ( unsigned long,
0 )
 

SPECIALIZE_EPSILON ( char,
0 )
 

SPECIALIZE_EPSILON ( bool,
0 )
 

SPECIALIZE_EXACTNESS ( long double )
 

SPECIALIZE_EXACTNESS ( double )
 

SPECIALIZE_EXACTNESS ( float )
 

SPECIALIZE_EXPONENTS ( long double,
LDBL_MIN_EXP,
LDBL_MIN_10_EXP,
LDBL_MAX_EXP,
LDBL_MAX_10_EXP )
 

SPECIALIZE_EXPONENTS ( double,
DBL_MIN_EXP,
DBL_MIN_10_EXP,
DBL_MAX_EXP,
DBL_MAX_10_EXP )
 

SPECIALIZE_EXPONENTS ( float,
FLT_MIN_EXP,
FLT_MIN_10_EXP,
FLT_MAX_EXP,
FLT_MAX_10_EXP )
 

SPECIALIZE_IEC559 ( long )
 

SPECIALIZE_IEC559 ( unsigned long )
 

SPECIALIZE_IEC559 ( int )
 

SPECIALIZE_IEC559 ( bool )
 

SPECIALIZE_RADIX ( long double,
FLT_RADIX )
 

SPECIALIZE_RADIX ( double,
FLT_RADIX )
 

SPECIALIZE_RADIX ( float,
FLT_RADIX )
 

SPECIALIZE_ROUND_ERROR ( long double,
1. 0L )
 

SPECIALIZE_ROUND_ERROR ( double,
1. 0 )
 

SPECIALIZE_ROUND_ERROR ( float,
1. 0f )
 

SPECIALIZE_ROUND_ERROR ( long long,
0 )
 

SPECIALIZE_ROUND_ERROR ( int,
0 )
 

SPECIALIZE_ROUND_ERROR ( short,
0 )
 

SPECIALIZE_ROUND_ERROR ( wchar_t,
0 )
 

SPECIALIZE_ROUND_ERROR ( signed char,
0 )
 

SPECIALIZE_ROUND_ERROR ( unsigned long,
0 )
 

SPECIALIZE_ROUND_ERROR ( char,
0 )
 

SPECIALIZE_ROUND_ERROR ( bool,
0 )
 

SPECIALIZE_TRAPPING ( unsigned long )
 

void digits ( )
 

Definition at line 568 of file gen-num-limits.cc.

void digits10 ( )
 

Definition at line 575 of file gen-num-limits.cc.

void epsilon ( )
 

Definition at line 589 of file gen-num-limits.cc.

void has_denorm_loss ( )
 

Definition at line 654 of file gen-num-limits.cc.

void has_infinity ( )
 

Definition at line 633 of file gen-num-limits.cc.

void has_quiet_nan ( )
 

Definition at line 640 of file gen-num-limits.cc.

void has_signaling_nan ( )
 

Definition at line 647 of file gen-num-limits.cc.

void is_exact ( )
 

Definition at line 561 of file gen-num-limits.cc.

void is_iec559 ( )
 

Definition at line 703 of file gen-num-limits.cc.

void is_integer ( )
 

Definition at line 554 of file gen-num-limits.cc.

void is_modulo ( )
 

Definition at line 533 of file gen-num-limits.cc.

void is_signed ( )
 

Definition at line 526 of file gen-num-limits.cc.

int main ( )
 

Definition at line 773 of file gen-num-limits.cc.

void max ( )
 

Definition at line 547 of file gen-num-limits.cc.

Referenced by _CPP_BITS_FSTREAM_TCC(), _CPP_BITS_SSTREAM_TCC(), std::vector< bool, _Alloc >::_M_fill_insert(), std::vector< bool, _Alloc >::_M_insert_range(), allocator::init_page_size(), allocator::max_size(), std::operator>>(), and std::basic_stringbuf::str().

void max_exponent ( )
 

Definition at line 619 of file gen-num-limits.cc.

void max_exponent10 ( )
 

Definition at line 626 of file gen-num-limits.cc.

void min ( )
 

Definition at line 540 of file gen-num-limits.cc.

Referenced by _CPP_BITS_STREAMBUF_TCC(), std::basic_streambuf::_M_pback_create(), std::_S_string_copy(), std::basic_string::compare(), and std::numeric_limits< unsigned char >::round_style().

void min_exponent ( )
 

Definition at line 605 of file gen-num-limits.cc.

void min_exponent10 ( )
 

Definition at line 612 of file gen-num-limits.cc.

void radix ( )
 

Definition at line 582 of file gen-num-limits.cc.

void round_error ( )
 

Definition at line 597 of file gen-num-limits.cc.

void round_style ( )
 

Definition at line 718 of file gen-num-limits.cc.

void (*)(int) signal_adapter ( ) [inline]
 

Definition at line 114 of file gen-num-limits.cc.

Referenced by signal_handler(), and traps().

void signal_handler ( int sig )
 

Definition at line 131 of file gen-num-limits.cc.

void tinyness_before ( )
 

Definition at line 711 of file gen-num-limits.cc.

bool trapping ( const Operation & op )
 

Definition at line 143 of file gen-num-limits.cc.

Referenced by traps().

void traps ( )
 

Definition at line 178 of file gen-num-limits.cc.


Variable Documentation

const int bits_per_byte = CHAR_BIT
 

Definition at line 81 of file gen-num-limits.cc.

const char* bool_alpha[] = { "false", "true" }
 

Definition at line 79 of file gen-num-limits.cc.

sigjmp_buf env
 

Definition at line 109 of file gen-num-limits.cc.

const int integer_base_rep = 2
 

Definition at line 82 of file gen-num-limits.cc.

const double log10_of_two = .30102999566398119
 

Definition at line 80 of file gen-num-limits.cc.

const char tab[] = " "
 

Definition at line 77 of file gen-num-limits.cc.

const char tab2[] = " "
 

Definition at line 78 of file gen-num-limits.cc.


Generated at Tue May 1 16:28:53 2001 for libstdc++-v3 by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001