CNL
2.0.2 (development)
Compositional Numeric Library
|
Go to the documentation of this file.
7 #if !defined(CNL_STATIC_NUBER_H)
8 #define CNL_STATIC_NUBER_H
13 #include "_impl/static_integer.h"
14 #include "_impl/wrapper/tag_of.h"
32 int Digits,
int Exponent = 0, rounding_tag RoundingTag = nearest_rounding_tag,
33 overflow_tag OverflowTag = undefined_overflow_tag, integer Narrowest =
int>
35 _impl::static_integer<Digits, RoundingTag, OverflowTag, Narrowest>,
power<Exponent>>;
40 integer Narrowest = int,
class Input =
int>
49 rounding_tag RoundingTag = _impl::tag_of_t<rounding_integer<>>,
50 overflow_tag OverflowTag = _impl::tag_of_t<overflow_integer<>>, integer Narrowest = int,
51 class Input = int, CNL_IMPL_CONSTANT_VALUE_TYPE Value>
53 _impl::used_digits(Value) - trailing_bits(Value), trailing_bits(Value), RoundingTag,
54 OverflowTag, Narrowest>
60 #endif // CNL_STATIC_NUBER_H
all definitions related to the cnl::scaled_integer type
tag to specify undefined-behavior-on-overflow behavior in arithemtic operations
Definition: undefined.h:31
compositional numeric library
Definition: abort.h:15
tag to specify round-to-nearest behavior in arithemtic operations
Definition: nearest_rounding_tag.h:26
scaled_integer< _impl::static_integer< Digits, RoundingTag, OverflowTag, Narrowest >, power< Exponent > > static_number
a general-purpose fixed-point real number type
Definition: static_number.h:35
_impl::wrapper< Rep, Scale > scaled_integer
literal real number approximation that uses fixed-point arithmetic
Definition: definition.h:52
type whose value is also its non-type template parameter
Definition: constant.h:44
constexpr auto make_static_number(Input const &input) -> static_number< std::numeric_limits< Input >::digits, 0, RoundingTag, OverflowTag, Narrowest >
constructs a static_number from a given variable
Definition: static_number.h:41
tag representing the scaling of an integer by a fixed factor
Definition: declaration.h:13