public void ResetProcess(Mode mode) { currentMode = mode; switch (mode) { case Mode.PNumber: leftNumber = new PNumber(); rightNumber = new PNumber(); break; case Mode.Fractional: leftNumber = new FNumber(); rightNumber = new FNumber(); break; case Mode.Complex: leftNumber = new CNumber(); rightNumber = new CNumber(); break; default: throw new ArgumentOutOfRangeException(nameof(mode), mode, null); } operation = Operation.None; function = Function.None; }
public override Number Inverse() { var res = new CNumber(1, 0).Divide(this); real = (res as CNumber)?.real; imaginary = (res as CNumber)?.imaginary; return(this); }
public void Reset(Processor.Mode mode) { memoryState = State.Off; switch (mode) { case Processor.Mode.PNumber: number = new PNumber(); break; case Processor.Mode.Fractional: number = new FNumber(); break; case Processor.Mode.Complex: number = new CNumber(); break; default: throw new ArgumentOutOfRangeException(nameof(mode), mode, null); } }