1 write to m_real
System.Runtime.Numerics (1)
System\Numerics\Complex.Generic.cs (1)
49
m_real
= real;
107 references to m_real
System.Runtime.Numerics (107)
System\Numerics\Complex.Generic.cs (107)
53
public T Real =>
m_real
;
57
public T GetPhase() => T.Atan2(m_imaginary,
m_real
);
132
return new Complex<T>(-value.
m_real
, -value.m_imaginary);
137
return new Complex<T>(left.
m_real
+ right.
m_real
, left.m_imaginary + right.m_imaginary);
142
return new Complex<T>(left.
m_real
+ right, left.m_imaginary);
147
return new Complex<T>(left + right.
m_real
, right.m_imaginary);
152
return new Complex<T>(left.
m_real
- right.
m_real
, left.m_imaginary - right.m_imaginary);
157
return new Complex<T>(left.
m_real
- right, left.m_imaginary);
162
return new Complex<T>(left - right.
m_real
, -right.m_imaginary);
168
T result_realpart = (left.
m_real
* right.
m_real
) - (left.m_imaginary * right.m_imaginary);
169
T result_imaginarypart = (left.m_imaginary * right.
m_real
) + (left.
m_real
* right.m_imaginary);
175
if (!T.IsFinite(left.
m_real
))
182
return new Complex<T>(left.
m_real
* right, T.NaN);
190
return new Complex<T>(left.
m_real
* right, left.m_imaginary * right);
195
if (!T.IsFinite(right.
m_real
))
202
return new Complex<T>(left * right.
m_real
, T.NaN);
210
return new Complex<T>(left * right.
m_real
, left * right.m_imaginary);
216
T a = left.
m_real
;
218
T c = right.
m_real
;
244
if (!T.IsFinite(left.
m_real
))
251
return new Complex<T>(left.
m_real
/ right, T.NaN);
260
return new Complex<T>(left.
m_real
/ right, left.m_imaginary / right);
267
T c = right.
m_real
;
285
return T.Hypot(value.
m_real
, value.m_imaginary);
316
return new Complex<T>(value.
m_real
, -value.m_imaginary);
322
if (value.
m_real
== T.Zero && value.m_imaginary == T.Zero)
331
return left.
m_real
== right.
m_real
&& left.m_imaginary == right.m_imaginary;
336
return left.
m_real
!= right.
m_real
|| left.m_imaginary != right.m_imaginary;
346
return
m_real
.Equals(value.
m_real
) && m_imaginary.Equals(value.m_imaginary);
349
public override int GetHashCode() => HashCode.Combine(
m_real
, m_imaginary);
362
handler.AppendFormatted(
m_real
, format);
371
(T sin, T cos) = T.SinCos(value.
m_real
);
378
Complex<T> sin = Sin(new Complex<T>(-value.m_imaginary, value.
m_real
));
379
return new Complex<T>(sin.m_imaginary, -sin.
m_real
);
404
(T sin, T cos) = T.SinCos(value.
m_real
);
411
return Cos(new Complex<T>(-value.m_imaginary, value.
m_real
));
446
T x2 = two * value.
m_real
;
465
Complex<T> tan = Tan(new Complex<T>(-value.m_imaginary, value.
m_real
));
466
return new Complex<T>(tan.m_imaginary, -tan.
m_real
);
558
public static bool IsFinite(Complex<T> value) => T.IsFinite(value.
m_real
) && T.IsFinite(value.m_imaginary);
560
public static bool IsInfinity(Complex<T> value) => T.IsInfinity(value.
m_real
) || T.IsInfinity(value.m_imaginary);
566
return new Complex<T>(T.Log(Abs(value)), T.Atan2(value.m_imaginary, value.
m_real
));
582
T expReal = T.Exp(value.
m_real
);
589
if (T.IsNaN(value.
m_real
))
599
if (T.IsPositiveInfinity(value.
m_real
))
603
if (T.IsNegativeInfinity(value.
m_real
))
613
if (value.
m_real
< T.Zero)
615
return new Complex<T>(T.Zero, T.Sqrt(-value.
m_real
));
618
return new Complex<T>(T.Sqrt(value.
m_real
), T.Zero);
625
T realCopy = value.
m_real
;
678
T valueReal = value.
m_real
;
680
T powerReal = power.
m_real
;
699
T realResult = factor * value.
m_real
;
812
public static bool IsComplexNumber(Complex<T> value) => (value.
m_real
!= T.Zero) && (value.m_imaginary != T.Zero);
815
public static bool IsEvenInteger(Complex<T> value) => (value.m_imaginary == T.Zero) && T.IsEvenInteger(value.
m_real
);
818
public static bool IsImaginaryNumber(Complex<T> value) => (value.
m_real
== T.Zero) && T.IsRealNumber(value.m_imaginary);
821
public static bool IsInteger(Complex<T> value) => (value.m_imaginary == T.Zero) && T.IsInteger(value.
m_real
);
829
return (value.m_imaginary == T.Zero) && T.IsNegative(value.
m_real
);
838
return (value.m_imaginary == T.Zero) && T.IsNegativeInfinity(value.
m_real
);
847
return T.IsNormal(value.
m_real
)
852
public static bool IsOddInteger(Complex<T> value) => (value.m_imaginary == T.Zero) && T.IsOddInteger(value.
m_real
);
860
return (value.m_imaginary == T.Zero) && T.IsPositive(value.
m_real
);
869
return (value.m_imaginary == T.Zero) && T.IsPositiveInfinity(value.
m_real
);
873
public static bool IsRealNumber(Complex<T> value) => (value.m_imaginary == T.Zero) && T.IsRealNumber(value.
m_real
);
881
return T.IsSubnormal(value.
m_real
) || T.IsSubnormal(value.m_imaginary);
885
static bool INumberBase<Complex<T>>.IsZero(Complex<T> value) => (value.
m_real
== T.Zero) && (value.m_imaginary == T.Zero);
923
if (T.IsNegative(y.
m_real
))
931
if (T.IsNegative(x.
m_real
))
943
if (T.IsNegative(x.
m_real
))
979
if (T.IsNegative(y.
m_real
))
987
if (T.IsNegative(x.
m_real
))
999
if (T.IsNegative(x.
m_real
))
1040
if (T.IsNegative(y.
m_real
))
1048
if (T.IsNegative(x.
m_real
))
1060
if (T.IsNegative(x.
m_real
))
1100
if (T.IsNegative(y.
m_real
))
1108
if (T.IsNegative(x.
m_real
))
1120
if (T.IsNegative(x.
m_real
))
1147
T result_realpart = addend.
m_real
;
1149
result_realpart = T.MultiplyAddEstimate(left.
m_real
, right.
m_real
, result_realpart);
1152
result_imaginarypart = T.MultiplyAddEstimate(left.
m_real
, right.m_imaginary, result_imaginarypart);
1153
result_imaginarypart = T.MultiplyAddEstimate(left.m_imaginary, right.
m_real
, result_imaginarypart);
1351
result = (TOther)(object)((value.m_imaginary != T.Zero) ? T.NaN : value.
m_real
);
1357
result = (TOther)(object)new Complex(double.CreateChecked(value.
m_real
), double.CreateChecked(value.m_imaginary));
1368
BigInteger actualResult = checked((BigInteger)double.CreateChecked(value.
m_real
));
1384
if (T.TryConvertToChecked(value.
m_real
, out result))
1389
return TOther.TryConvertFromChecked<T>(value.
m_real
, out result);
1397
result = (TOther)(object)value.
m_real
;
1403
result = (TOther)(object)new Complex(double.CreateSaturating(value.
m_real
), double.CreateSaturating(value.m_imaginary));
1409
BigInteger actualResult = (BigInteger)double.CreateSaturating(value.
m_real
);
1415
if (T.TryConvertToSaturating(value.
m_real
, out result))
1420
return TOther.TryConvertFromSaturating<T>(value.
m_real
, out result);
1428
result = (TOther)(object)value.
m_real
;
1434
result = (TOther)(object)new Complex(double.CreateTruncating(value.
m_real
), double.CreateTruncating(value.m_imaginary));
1440
BigInteger actualResult = (BigInteger)double.CreateTruncating(value.
m_real
);
1446
if (T.TryConvertToTruncating(value.
m_real
, out result))
1451
return TOther.TryConvertFromTruncating<T>(value.
m_real
, out result);
1637
?
m_real
.TryFormat(Unsafe.BitCast<Span<TChar>, Span<byte>>(destination.Slice(1)), out int realChars, format, provider)
1638
:
m_real
.TryFormat(Unsafe.BitCast<Span<TChar>, Span<char>>(destination.Slice(1)), out realChars, format, provider))