Beispiel #1
0
 public static Complex Round(Complex a)
 {
     if (!a.IsReal()) return new Complex(Round(a.Real), Round(a.Imaginary), a.ViewMode, a.IsIndeterminate());
     return Abs(Frac(a)) < 0.5 ? Floor(a) : Ceil(a);
 }
Beispiel #2
0
 public static Complex Round(Complex a, Complex b)
 {
     return new Complex(Math.Round(a.Real, (int)b), Math.Round(a.Imaginary, (int)b), a.ViewMode, a.IsIndeterminate());
 }