NVIDIA Iray: Math API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::base::numeric_traits< T > Struct Template Reference

Helper class to deduce properties of numeric types defined in this API. More...

+ Inheritance diagram for mi::base::numeric_traits< T >:

Static Public Member Functions

static T() min () throw ()
 Returns the minimum finite value for T (and for floating point types the minimum positive value). More...
 
static T() max () throw ()
 Returns the maximum finite value for T. More...
 
static T negative_max () throw ()
 Returns the smallest finite negative value for T. More...
 
static T infinity () throw ()
 Returns an infinity value for T, if one exists, and T() otherwise. More...
 
static T quiet_NaN () throw ()
 Returns a quiet NaN value for T, if one exists, and T() otherwise. More...
 
static T signaling_NaN () throw ()
 Returns a signaling NaN value for T, if one exists, and T() otherwise. More...
 

Static Public Attributes

static const bool is_specialized = false
 Constant that is true if and only if this traits is specialized for T. More...
 
static const bool has_infinity = false
 Constant that is true if and only if T has an infinity representation. More...
 
static const bool has_quiet_NaN = false
 Constant that is true if and only if T has a quiet NaN (not-a-number) representation. More...
 
static const bool has_signaling_NaN = false
 Constant that is true if and only if T has a signaling NaN (not-a-number) representation. More...
 

Detailed Description

template<typename T>
struct mi::base::numeric_traits< T >

Helper class to deduce properties of numeric types defined in this API.

This class can be used in generic code to deduce the limits and special values, such as a signaling NaN, for number types defined in this API, such as mi::Uint32 and mi::Float64.

The default template defines all members, see mi::base::numeric_traits_base, but with default constructed or false values. It requires that a value of T can be default constructed.

This traits class is similar to std::numeric_limits<T>, and in case of overlap behaves in the same way.

Member Function Documentation

template<typename T>
static T mi::base::numeric_traits_base< T >::infinity ( )
throw (
)
inlinestaticinherited

Returns an infinity value for T, if one exists, and T() otherwise.

template<typename T>
static T() mi::base::numeric_traits_base< T >::max ( )
throw (
)
inlinestaticinherited

Returns the maximum finite value for T.

The value is equivalent to standard C constants CHAR_MAX, SHRT_MAX, FLT_MAX, DBL_MAX, etc.

Returns
the maximum finite value for T.
template<typename T>
static T() mi::base::numeric_traits_base< T >::min ( )
throw (
)
inlinestaticinherited

Returns the minimum finite value for T (and for floating point types the minimum positive value).

The value is equivalent to standard C constants CHAR_MIN, SHRT_MIN, FLT_MIN, DBL_MIN, etc.

Returns
the minimum finite value for T.
template<typename T>
static T mi::base::numeric_traits_base< T >::negative_max ( )
throw (
)
inlinestaticinherited

Returns the smallest finite negative value for T.

For signed integer types this value is typically (-max()-1). For unsigned integer types it is 0. For floating point types it is typically (-max()).

Returns
the smallest finite negative value for T.
template<typename T>
static T mi::base::numeric_traits_base< T >::quiet_NaN ( )
throw (
)
inlinestaticinherited

Returns a quiet NaN value for T, if one exists, and T() otherwise.

template<typename T>
static T mi::base::numeric_traits_base< T >::signaling_NaN ( )
throw (
)
inlinestaticinherited

Returns a signaling NaN value for T, if one exists, and T() otherwise.

Member Data Documentation

template<typename T>
const bool mi::base::numeric_traits_base< T >::has_infinity = false
staticinherited

Constant that is true if and only if T has an infinity representation.

You can get the infinity representation through the infinity() method.

template<typename T>
const bool mi::base::numeric_traits_base< T >::has_quiet_NaN = false
staticinherited

Constant that is true if and only if T has a quiet NaN (not-a-number) representation.

You can get the quiet NaN representation through the quiet_NaN() method.

template<typename T>
const bool mi::base::numeric_traits_base< T >::has_signaling_NaN = false
staticinherited

Constant that is true if and only if T has a signaling NaN (not-a-number) representation.

You can get the signaling NaN representation through the signaling_NaN() method.

template<typename T>
const bool mi::base::numeric_traits_base< T >::is_specialized = false
staticinherited

Constant that is true if and only if this traits is specialized for T.