public PBNumber(NumberCapacity inWidth, String inSign, String inExponent, String inMantissa, RoundingType inRounding) { this.width = inWidth; switch (this.width) { case NumberCapacity.PB32: { this.offset = NumberOffset.PB32; this.exponentLenght = NumberExponentLength.PB32; this.mantissaLenght = NumberMantissaLength.PB32; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB32]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB32]; break; } case NumberCapacity.PB64: { this.offset = NumberOffset.PB64; this.exponentLenght = NumberExponentLength.PB64; this.mantissaLenght = NumberMantissaLength.PB64; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB64]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB64]; break; } case NumberCapacity.PB128: { this.offset = NumberOffset.PB128; this.exponentLenght = NumberExponentLength.PB128; this.mantissaLenght = NumberMantissaLength.PB128; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB128]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB128]; break; } case NumberCapacity.PB256: { this.offset = NumberOffset.PB256; this.exponentLenght = NumberExponentLength.PB256; this.mantissaLenght = NumberMantissaLength.PB256; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB256]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB256]; break; } default: { break; } } this.name = "Name-" + this.width.ToString() + "[" + inSign + inExponent + "|" + inMantissa + "]"; this.sign = inSign; this.Exponent = inExponent; this.Mantissa = inMantissa; this.roundingType = inRounding; if (pbConvertion == null) pbConvertion = new PBConvertion(); }
public PBNumber(NumberCapacity inWidth) { this.width = inWidth; switch (this.width) { case NumberCapacity.PB32: { this.offset = NumberOffset.PB32; this.exponentLenght = NumberExponentLength.PB32; this.mantissaLenght = NumberMantissaLength.PB32; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB32]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB32]; break; } case NumberCapacity.PB64: { this.offset = NumberOffset.PB64; this.exponentLenght = NumberExponentLength.PB64; this.mantissaLenght = NumberMantissaLength.PB64; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB64]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB64]; break; } case NumberCapacity.PB128: { this.offset = NumberOffset.PB128; this.exponentLenght = NumberExponentLength.PB128; this.mantissaLenght = NumberMantissaLength.PB128; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB128]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB128]; break; } case NumberCapacity.PB256: { this.offset = NumberOffset.PB256; this.exponentLenght = NumberExponentLength.PB256; this.mantissaLenght = NumberMantissaLength.PB256; this.mf = IPBNumber.NumberMFs[(int)NumberMF.PB256]; this.cf = IPBNumber.NumberCFs[(int)NumberCF.PB256]; break; } default: { break; } } this.name = "Name-" + this.width.ToString() + "[]"; if (pbConvertion == null) pbConvertion = new PBConvertion(); }