xtd 0.2.0
Loading...
Searching...
No Matches
box_floating_point.h
Go to the documentation of this file.
1
4#pragma once
5#include "box_integer.h"
6#define __XTD_CORE_INTERNAL__
8#undef __XTD_CORE_INTERNAL__
9
11namespace xtd {
40 template<typename type_t>
41 class box_floating_point : public xtd::box_integer<type_t> {
42 public:
44 box_floating_point() = default;
46 box_floating_point(const box_floating_point&) = default;
48 box_floating_point& operator =(const box_floating_point&) = default;
50
52
56 static constexpr type_t epsilon = __get_epsilon(type_t{});
59 static constexpr type_t NaN = std::numeric_limits<type_t>::quiet_NaN();
62 static constexpr type_t negative_infinity = -std::numeric_limits<type_t>::infinity();
65 static constexpr type_t positive_infinity = +std::numeric_limits<type_t>::infinity();
67
69
74 static bool is_finite(type_t value) noexcept {return !is_infinity(value);}
78 static bool is_infinity(type_t value) noexcept {return is_negative_infinity(value) || is_positive_infinity(value);}
79
83 static bool is_negative_infinity(type_t value) noexcept {return value <= negative_infinity;}
84
88 static bool is_positive_infinity(type_t value) noexcept {return value >= positive_infinity;}
89
93 static bool is_NaN(type_t value) noexcept {return value != value;}
95 };
96}
Contains internal math methods.
Contains xtd::box_integer class.
Represents a boxed floating point object.
Definition box_floating_point.h:41
static bool is_finite(type_t value) noexcept
Determines whether the specified value is finite (zero, subnormal, or normal).
Definition box_floating_point.h:74
static constexpr type_t epsilon
Represents the smallest positive type_t value greater than zero. This field is constant.
Definition box_floating_point.h:56
static bool is_NaN(type_t value) noexcept
Returns a value indicating whether the specified number evaluates to not a number.
Definition box_floating_point.h:93
static constexpr type_t NaN
Represents not a number (NaN). This field is constant.
Definition box_floating_point.h:59
static bool is_positive_infinity(type_t value) noexcept
Returns a value indicating whether the specified number evaluates to positive infinity.
Definition box_floating_point.h:88
static bool is_infinity(type_t value) noexcept
Returns a value indicating whether the specified number evaluates to negative or positive infinity.
Definition box_floating_point.h:78
static constexpr type_t positive_infinity
Represents positive infinity. This field is constant.
Definition box_floating_point.h:65
static bool is_negative_infinity(type_t value) noexcept
Returns a value indicating whether the specified number evaluates to negative infinity.
Definition box_floating_point.h:83
static constexpr type_t negative_infinity
Represents negative infinity. This field is constant.
Definition box_floating_point.h:62
Represents a boxed integer object.
Definition box_integer.h:52
const type_t & value() const noexcept
Gets the underlying value.
Definition box.h:85
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10