Logo Search packages:      
Sourcecode: poco version File versions  Download package

Poco::FPEnvironment Class Reference

#include <FPEnvironment.h>

Inheritance diagram for Poco::FPEnvironment:

List of all members.


Detailed Description

Instances of this class can be used to save and later restore the current floating point environment (consisting of rounding mode and floating-point flags). The class also provides various static methods to query certain properties of a floating-point number.

Definition at line 64 of file FPEnvironment.h.


Public Types

enum  Flag {
  FP_DIVIDE_BY_ZERO = FP_DIVIDE_BY_ZERO_IMPL, FP_INEXACT = FP_INEXACT_IMPL, FP_OVERFLOW = FP_OVERFLOW_IMPL, FP_UNDERFLOW = FP_UNDERFLOW_IMPL,
  FP_INVALID = FP_INVALID_IMPL
}
enum  RoundingMode { FP_ROUND_DOWNWARD = FP_ROUND_DOWNWARD_IMPL, FP_ROUND_UPWARD = FP_ROUND_UPWARD_IMPL, FP_ROUND_TONEAREST = FP_ROUND_TONEAREST_IMPL, FP_ROUND_TOWARDZERO = FP_ROUND_TOWARDZERO_IMPL }

Public Member Functions

 FPEnvironment (const FPEnvironment &env)
 FPEnvironment (RoundingMode mode)
void keepCurrent ()
 Assignment operator.
FPEnvironmentoperator= (const FPEnvironment &env)
 ~FPEnvironment ()
 Copy constructor.

Static Public Member Functions

static void clearFlags ()
static long double copySign (long double target, long double source)
static double copySign (double target, double source)
static float copySign (float target, float source)
 Returns true iff the given number is NaN.
static RoundingMode getRoundingMode ()
 Sets the rounding mode.
static bool isFlag (Flag flag)
 Resets all flags.
static bool isInfinite (long double value)
static bool isInfinite (double value)
static bool isInfinite (float value)
 Returns the current rounding mode.
static bool isNaN (long double value)
static bool isNaN (double value)
static bool isNaN (float value)
 Returns true iff the given number is infinite.
static void setRoundingMode (RoundingMode mode)
 Returns true iff the given flag is set.

Private Types

enum  FlagImpl {
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW,
  FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT,
  FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
  FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID,
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID
}
enum  FlagImpl {
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW,
  FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT,
  FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
  FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID,
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID
}
enum  FlagImpl {
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW,
  FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT,
  FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
  FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID,
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID
}
enum  FlagImpl {
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW,
  FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT,
  FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
  FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID,
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID
}
enum  FlagImpl {
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW,
  FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT,
  FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID, FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO,
  FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW, FP_INVALID_IMPL = FE_INVALID,
  FP_DIVIDE_BY_ZERO_IMPL = FE_DIVBYZERO, FP_INEXACT_IMPL = FE_INEXACT, FP_OVERFLOW_IMPL = FE_OVERFLOW, FP_UNDERFLOW_IMPL = FE_UNDERFLOW,
  FP_INVALID_IMPL = FE_INVALID
}
enum  RoundingModeImpl {
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
}
enum  RoundingModeImpl {
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
}
enum  RoundingModeImpl {
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
}
enum  RoundingModeImpl {
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
}
enum  RoundingModeImpl {
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO,
  FP_ROUND_DOWNWARD_IMPL = FE_DOWNWARD, FP_ROUND_UPWARD_IMPL = FE_UPWARD, FP_ROUND_TONEAREST_IMPL = FE_TONEAREST, FP_ROUND_TOWARDZERO_IMPL = FE_TOWARDZERO
}

Private Member Functions

void keepCurrentImpl ()
void keepCurrentImpl ()
void keepCurrentImpl ()
void keepCurrentImpl ()
void keepCurrentImpl ()

Static Private Member Functions

static void clearFlagsImpl ()
static void clearFlagsImpl ()
static void clearFlagsImpl ()
static void clearFlagsImpl ()
static void clearFlagsImpl ()
static long double copySignImpl (long double target, long double source)
static double copySignImpl (double target, double source)
static float copySignImpl (float target, float source)
static long double copySignImpl (long double target, long double source)
static double copySignImpl (double target, double source)
static float copySignImpl (float target, float source)
static long double copySignImpl (long double target, long double source)
static double copySignImpl (double target, double source)
static float copySignImpl (float target, float source)
static long double copySignImpl (long double target, long double source)
static double copySignImpl (double target, double source)
static float copySignImpl (float target, float source)
static long double copySignImpl (long double target, long double source)
static double copySignImpl (double target, double source)
static float copySignImpl (float target, float source)
static RoundingModeImpl getRoundingModeImpl ()
static RoundingModeImpl getRoundingModeImpl ()
static RoundingModeImpl getRoundingModeImpl ()
static RoundingModeImpl getRoundingModeImpl ()
static RoundingModeImpl getRoundingModeImpl ()
static bool isFlagImpl (FlagImpl flag)
static bool isFlagImpl (FlagImpl flag)
static bool isFlagImpl (FlagImpl flag)
static bool isFlagImpl (FlagImpl flag)
static bool isFlagImpl (FlagImpl flag)
static bool isInfiniteImpl (long double value)
static bool isInfiniteImpl (double value)
static bool isInfiniteImpl (float value)
static bool isInfiniteImpl (long double value)
static bool isInfiniteImpl (double value)
static bool isInfiniteImpl (float value)
static bool isInfiniteImpl (long double value)
static bool isInfiniteImpl (double value)
static bool isInfiniteImpl (float value)
static bool isInfiniteImpl (long double value)
static bool isInfiniteImpl (double value)
static bool isInfiniteImpl (float value)
static bool isInfiniteImpl (long double value)
static bool isInfiniteImpl (double value)
static bool isInfiniteImpl (float value)
static bool isNaNImpl (long double value)
static bool isNaNImpl (double value)
static bool isNaNImpl (float value)
static bool isNaNImpl (long double value)
static bool isNaNImpl (double value)
static bool isNaNImpl (float value)
static bool isNaNImpl (long double value)
static bool isNaNImpl (double value)
static bool isNaNImpl (float value)
static bool isNaNImpl (long double value)
static bool isNaNImpl (double value)
static bool isNaNImpl (float value)
static bool isNaNImpl (long double value)
static bool isNaNImpl (double value)
static bool isNaNImpl (float value)
static void setRoundingModeImpl (RoundingModeImpl mode)
static void setRoundingModeImpl (RoundingModeImpl mode)
static void setRoundingModeImpl (RoundingModeImpl mode)
static void setRoundingModeImpl (RoundingModeImpl mode)
static void setRoundingModeImpl (RoundingModeImpl mode)

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index