# diadic< NT_ > Class Template Reference

List of all members.

## Detailed Description

### template<typename NT_> class diadic< NT_ >

This class provides arithmetic operations on numbers which are an integer of type `NT_`, times a power of 2, which is stored by as its exponent.

Definition at line 41 of file diadic.h.

typedef NT_ NT

## Public Member Functions

diadic (const NT &n, int d=0)
template<typename RT>
diadic (const RT &n, int d=0)
diadic< NT > & operator/= (int r)
diadic< NT > & operator+= (const NT &r)
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 NTnumerator () const
NT denominator () const
int valuation () const

NT num_
int exp_

## Member Function Documentation

template<typename NT>

Definition at line 97 of file diadic.h.

template<typename NT>

Definition at line 121 of file diadic.h.

template<typename NT>

Definition at line 144 of file diadic.h.

template<typename NT>

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.

template<typename NT>

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.

template<typename NT>
 diadic< NT > & diadic< NT >::operator+= ( const NT & r )

Definition at line 201 of file diadic.h.

template<typename NT>
 diadic< NT > & diadic< NT >::operator-= ( const NT & r )

Inplace substraction of a diadic number with an integer.

Definition at line 219 of file diadic.h.

template<typename NT>
 diadic< NT > & diadic< NT >::operator *= ( const NT & r )

Inplace multiplication of a diadic number with an integer.

Definition at line 237 of file diadic.h.

template<typename NT>
 diadic< NT > & diadic< NT >::operator/= ( const NT & r )

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.