DiyFp
Namespace: SnowBank.Numerics · struct
This "Do It Yourself Floating Point" class implements a floating-point number with a uint64 significand and an int exponent. Normalized DiyFp numbers will have the most significant bit of the significand set. Multiplication and Subtraction do not normalize their results. DiyFp are not designed to contain special doubles (NaN and Infinity).
Constructors
DiyFp
DiyFp(ulong significant, int exponent)
Methods
Minus
static DiyFp Minus(ref DiyFp a, ref DiyFp b)
MinusSignificand
static ulong MinusSignificand(ref DiyFp a, ref DiyFp b)
Same as Minus but only returns the significand
Multiply
void Multiply(DiyFp other)
Normalize
void Normalize()
Normalized
static DiyFp Normalized(ref DiyFp a)
static DiyFp Normalized(ulong significand, int exponent)
Subtract
void Subtract(DiyFp other)
Times
static DiyFp Times(ref DiyFp a, ref DiyFp b)
Fields
E
int E
Exponent
F
ulong F
Significand (64-bit)
SignificandSize
const int SignificandSize
Zero
static readonly DiyFp Zero