FPEnvironment_SUN.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // FPEnvironment_SUN.h
  3. //
  4. // Library: Foundation
  5. // Package: Core
  6. // Module: FPEnvironment
  7. //
  8. // Definitions of class FPEnvironmentImpl for Solaris.
  9. //
  10. // Copyright (c) 2005-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef Foundation_FPEnvironment_SUN_INCLUDED
  16. #define Foundation_FPEnvironment_SUN_INCLUDED
  17. #include "Poco/Foundation.h"
  18. #include <ieeefp.h>
  19. namespace Poco {
  20. class FPEnvironmentImpl
  21. {
  22. protected:
  23. enum RoundingModeImpl
  24. {
  25. FP_ROUND_DOWNWARD_IMPL = FP_RM,
  26. FP_ROUND_UPWARD_IMPL = FP_RP,
  27. FP_ROUND_TONEAREST_IMPL = FP_RN,
  28. FP_ROUND_TOWARDZERO_IMPL = FP_RZ
  29. };
  30. enum FlagImpl
  31. {
  32. FP_DIVIDE_BY_ZERO_IMPL = FP_X_DZ,
  33. FP_INEXACT_IMPL = FP_X_IMP,
  34. FP_OVERFLOW_IMPL = FP_X_OFL,
  35. FP_UNDERFLOW_IMPL = FP_X_UFL,
  36. FP_INVALID_IMPL = FP_X_INV
  37. };
  38. FPEnvironmentImpl();
  39. FPEnvironmentImpl(const FPEnvironmentImpl& env);
  40. ~FPEnvironmentImpl();
  41. FPEnvironmentImpl& operator = (const FPEnvironmentImpl& env);
  42. void keepCurrentImpl();
  43. static void clearFlagsImpl();
  44. static bool isFlagImpl(FlagImpl flag);
  45. static void setRoundingModeImpl(RoundingModeImpl mode);
  46. static RoundingModeImpl getRoundingModeImpl();
  47. static bool isInfiniteImpl(float value);
  48. static bool isInfiniteImpl(double value);
  49. static bool isInfiniteImpl(long double value);
  50. static bool isNaNImpl(float value);
  51. static bool isNaNImpl(double value);
  52. static bool isNaNImpl(long double value);
  53. static float copySignImpl(float target, float source);
  54. static double copySignImpl(double target, double source);
  55. static long double copySignImpl(long double target, long double source);
  56. private:
  57. fp_rnd _rnd;
  58. fp_except _exc;
  59. };
  60. } // namespace Poco
  61. #endif // Foundation_FPEnvironment_SUN_INCLUDED