![]() |
mutable
A Database System for Research and Fast Prototyping
|
#include <WasmUtil.hpp>
Public Types | |
using | expr_type = Expr< Base > |
using | arithmetic_type = Base |
Public Member Functions | |
Decimal (Base value, uint32_t scale) | |
Constructs a Decimal from a given value at the given scale . | |
Decimal (expr_type value, uint32_t scale) | |
Constructs a Decimal from a given value at the given scale . | |
Decimal (Decimal &other) | |
Decimal (Decimal &&other) | |
expr_type | val () |
uint32_t | scale () const |
template<signed_integral To> | |
Expr< To > | to () |
Decimal | clone () const |
Decimal | operator~ () |
Bitwise negation is not supported by Decimal type. | |
Decimal | operator+ (Decimal other) |
template<typename T > requires expr_convertible<T> | |
and signed_integral< typename expr_t< T >::type > Decimal | operator+ (T &&other) |
Decimal | operator- (Decimal other) |
template<typename T > requires expr_convertible<T> | |
and signed_integral< typename expr_t< T >::type > Decimal | operator- (T &&other) |
Decimal | operator* (Decimal other) |
template<typename T > requires expr_convertible<T> | |
and signed_integral< typename expr_t< T >::type > Decimal | operator* (T &&other) |
Decimal | operator/ (Decimal other) |
template<typename T > requires expr_convertible<T> | |
and signed_integral< typename expr_t< T >::type > Decimal | operator/ (T &&other) |
template<typename T > requires false | |
Decimal | operator% (T &&) |
Modulo division is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | operator bitand (T &&) |
Bitwise and is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | operator bitor (T &&) |
Bitwise or is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | operator xor (T &&) |
Bitwise xor (exclusive or) is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | operator<< (T &&) |
Shift left is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | operator>> (T &&) |
Shift right is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | rotl (T &&) |
Shift right is not supported by Decimal type. | |
template<typename T > requires false | |
Decimal | rotr (T &&) |
Shift right is not supported by Decimal type. | |
void | dump (std::ostream &out) const |
void | dump () const |
Static Public Member Functions | |
static Decimal | Scaled (expr_type value, uint32_t scale) |
Constructs a Decimal from a given value at the given scale . | |
Private Attributes | |
uint32_t | scale_ |
| |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Decimal &d) |
Definition at line 92 of file WasmUtil.hpp.
using m::wasm::Decimal< Base >::arithmetic_type = Base |
Definition at line 95 of file WasmUtil.hpp.
using m::wasm::Decimal< Base >::expr_type = Expr<Base> |
Definition at line 94 of file WasmUtil.hpp.
|
inline |
Constructs a Decimal
from a given value
at the given scale
.
For example, a value
of 142
at a scale
of 2
would represent 1.42
.
Definition at line 104 of file WasmUtil.hpp.
References M_insist, and m::wasm::Decimal< Base >::scale().
|
inline |
Constructs a Decimal
from a given value
at the given scale
.
For example, a value
of 142
at a scale
of 2
would represent 1.42
.
Definition at line 110 of file WasmUtil.hpp.
|
inline |
Definition at line 112 of file WasmUtil.hpp.
|
inline |
Definition at line 113 of file WasmUtil.hpp.
|
inline |
Definition at line 131 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale_.
|
inline |
Definition at line 252 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::dump().
Referenced by m::wasm::Decimal< Base >::dump().
|
inline |
Definition at line 251 of file WasmUtil.hpp.
|
inline |
Bitwise and is not supported by Decimal
type.
Definition at line 214 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Bitwise or is not supported by Decimal
type.
Definition at line 219 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Bitwise xor (exclusive or) is not supported by Decimal
type.
Definition at line 224 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Modulo division is not supported by Decimal
type.
Definition at line 209 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Definition at line 182 of file WasmUtil.hpp.
References M_insist, m::powi(), m::wasm::Decimal< Base >::scale(), and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 194 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale(), and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 148 of file WasmUtil.hpp.
References m::powi(), m::wasm::Decimal< Base >::scale(), m::wasm::Decimal< Base >::scale_, and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 163 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale_, and m::wasm::Decimal< Base >::Scaled().
|
inline |
Definition at line 165 of file WasmUtil.hpp.
References m::powi(), m::wasm::Decimal< Base >::scale(), m::wasm::Decimal< Base >::scale_, and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 180 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale_, and m::wasm::Decimal< Base >::Scaled().
|
inline |
Definition at line 196 of file WasmUtil.hpp.
References m::powi(), m::wasm::Decimal< Base >::scale(), and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 204 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale(), and m::wasm::Decimal< Base >::val().
|
inline |
Shift left is not supported by Decimal
type.
Definition at line 229 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Shift right is not supported by Decimal
type.
Definition at line 234 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Bitwise negation is not supported by Decimal
type.
Definition at line 139 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Shift right is not supported by Decimal
type.
Definition at line 239 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Shift right is not supported by Decimal
type.
Definition at line 244 of file WasmUtil.hpp.
References M_unreachable.
|
inline |
Definition at line 126 of file WasmUtil.hpp.
References m::wasm::Decimal< Base >::scale_.
Referenced by m::wasm::Decimal< Base >::Decimal(), m::wasm::Decimal< Base >::operator*(), m::wasm::Decimal< Base >::operator+(), m::wasm::Decimal< Base >::operator-(), m::wasm::Decimal< Base >::operator/(), and m::wasm::Decimal< Base >::Scaled().
|
inlinestatic |
Constructs a Decimal
from a given value
at the given scale
.
For example, a value
of 142
at a scale
of 2
would represent 142.00
.
Definition at line 117 of file WasmUtil.hpp.
References m::powi(), m::wasm::Decimal< Base >::scale(), and m::wasm::value.
Referenced by m::wasm::Decimal< Base >::operator+(), and m::wasm::Decimal< Base >::operator-().
|
inline |
Definition at line 129 of file WasmUtil.hpp.
References m::powi(), m::wasm::Decimal< Base >::scale_, and m::wasm::Decimal< Base >::val().
|
inline |
Definition at line 124 of file WasmUtil.hpp.
Referenced by m::wasm::Decimal< Base >::operator*(), m::wasm::Decimal< Base >::operator+(), m::wasm::Decimal< Base >::operator-(), m::wasm::Decimal< Base >::operator/(), and m::wasm::Decimal< Base >::to().
|
friend |
Definition at line 247 of file WasmUtil.hpp.
|
private |
the number of decimal digits right of the decimal point
Definition at line 99 of file WasmUtil.hpp.
Referenced by m::wasm::Decimal< Base >::clone(), m::wasm::Decimal< Base >::operator+(), m::wasm::Decimal< Base >::operator-(), m::wasm::Decimal< Base >::scale(), and m::wasm::Decimal< Base >::to().