NT_
, times a power of 2, which is stored by as its exponent.
Definition at line 41 of file diadic.h.
Public Types | |
typedef NT_ | NT |
Public Member Functions | |
diadic () | |
diadic (const NT &n, int d=0) | |
template<typename RT> | |
diadic (const RT &n, int d=0) | |
diadic< NT > & | operator+= (const diadic< NT > &r) |
Inplace addition of diadic numbers. | |
diadic< NT > & | operator-= (const diadic< NT > &r) |
Inplace substraction of diadic numbers. | |
diadic< NT > & | operator *= (const diadic< NT > &r) |
Inplace multiplication of diadic numbers. | |
diadic< NT > & | operator/= (const diadic< NT > &r) |
diadic< NT > & | operator/= (int r) |
diadic< NT > & | operator+= (const NT &r) |
Inplace addition of a diadic number with an integer. | |
diadic< NT > & | operator-= (const NT &r) |
Inplace substraction of a diadic number with an integer. | |
diadic< NT > & | operator *= (const NT &r) |
Inplace multiplication of a diadic number with an integer. | |
diadic< NT > & | operator/= (const NT &r) |
diadic< NT > & | normalize () |
const NT & | numerator () const |
NT | denominator () const |
int | valuation () const |
Public Attributes | |
NT | num_ |
int | exp_ |
Inplace addition of diadic numbers.
Definition at line 97 of file diadic.h.
References diadic< NT_ >::exp_, diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace substraction of diadic numbers.
Definition at line 121 of file diadic.h.
References diadic< NT_ >::exp_, diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace multiplication of diadic numbers.
Definition at line 144 of file diadic.h.
References diadic< NT_ >::exp_, and diadic< NT_ >::num_.
Inplace division of diadic numbers. The numerator is divided inplace by the other denominators and the exponents are substracted. This corresponds to a euclidean division.
Definition at line 157 of file diadic.h.
References diadic< NT_ >::exp_, diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace division of a diadic number by an machine integer n
. The number n
is supposed to be a power of two.
Definition at line 189 of file diadic.h.
References diadic< NT_ >::exp_, and diadic< NT_ >::num_.
Inplace addition of a diadic number with an integer.
Definition at line 201 of file diadic.h.
References diadic< NT_ >::exp_, diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace substraction of a diadic number with an integer.
Definition at line 219 of file diadic.h.
References diadic< NT_ >::exp_, diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace multiplication of a diadic number with an integer.
Definition at line 237 of file diadic.h.
References diadic< NT_ >::normalize(), and diadic< NT_ >::num_.
Inplace division of a diadic number by an machine integer n
. The number n
is supposed to be a power of two.
Definition at line 171 of file diadic.h.
References diadic< NT_ >::exp_, and diadic< NT_ >::num_.