A dyadic number. More...
#include <dyadic.h>
Public Member Functions | |
dyadic (const int k1, const int n1) | |
operator double () const | |
Conversion to double. | |
dyadic (const double Arg, const unsigned int RelativeTolerance=1024) | |
dyadic & | move_forward (const unsigned int Arg) |
Move from k/2^n -> (k + Arg)/2^n. | |
dyadic & | operator++ () |
The next dyadic time prefix. | |
dyadic | operator++ (int) |
The next dyadic time postfix. | |
dyadic & | operator-- () |
The previous dyadic time prefix. | |
dyadic | operator-- (int) |
The previous dyadic time postfix. | |
dyadic | operator+ (const dyadic &Arg) const |
Arithmetic operators. | |
dyadic & | operator+= (const dyadic &Arg) |
dyadic | operator- (const dyadic &Arg) const |
dyadic & | operator-= (const dyadic &Arg) |
bool | operator< (const dyadic &Arg) const |
bool | operator> (const dyadic &Arg) const |
Public Attributes | |
int | k |
The numerator. | |
int | n |
2^n is the denominator. |
A dyadic number.
Class to hold a dyadic number with functionality to produce dyadics from doubles, standard arithmetic and more.
dyadic::dyadic | ( | const double | Arg, | |
const unsigned int | RelativeTolerance = 1024 | |||
) | [inline, explicit] |
Explicit construction that when given a double, returns a dyadic accurate to tolerance sig bits and with absolute value just larger than that of the double; 0 returns 0/2^INT_MAX.