Teuchos - Trilinos Tools Package Version of the Day
Static Public Member Functions
Teuchos::ValueTypeConversionTraits< int, double > Class Template Reference

Convert double to int, without compiler warnings, with optional range check. More...

#include <Teuchos_as.hpp>

List of all members.

Static Public Member Functions

static int convert (const double t)
 Convert the given double to an int.
static int safeConvert (const double t)
 Convert the given double to an int, checking for overflow first.

Detailed Description

template<>
class Teuchos::ValueTypeConversionTraits< int, double >

Convert double to int, without compiler warnings, with optional range check.

Definition at line 306 of file Teuchos_as.hpp.


Member Function Documentation

static int Teuchos::ValueTypeConversionTraits< int, double >::convert ( const double  t) [inline, static]

Convert the given double to an int.

Warning:
Double-precision floating-point values (64 bits) may overflow int (32 bits). You should use safeConvert() if you aren't sure that the given value fits in int.

Definition at line 313 of file Teuchos_as.hpp.

static int Teuchos::ValueTypeConversionTraits< int, double >::safeConvert ( const double  t) [inline, static]

Convert the given double to an int, checking for overflow first.

Definition at line 320 of file Teuchos_as.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines