From 373e0d8c8a663dcc95ffd63932c50ebe3f5f76ce Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Sun, 31 Jul 2022 17:08:49 +0600 Subject: [PATCH] Changes required for latest bits of .NET 7 --- System.Numerics.Rational/BigRational.Net7.cs | 24 ++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/System.Numerics.Rational/BigRational.Net7.cs b/System.Numerics.Rational/BigRational.Net7.cs index b12ae795..8c45bfe4 100644 --- a/System.Numerics.Rational/BigRational.Net7.cs +++ b/System.Numerics.Rational/BigRational.Net7.cs @@ -877,13 +877,13 @@ public static BigRational Hypot(BigRational x, BigRational y) } /// Computes the n-th root of a value. /// - /// Part of the new NET 7 number type system see .
+ /// Part of the new NET 7 number type system see .
/// The desired precision can preset by ///
/// The value whose -th root is to be computed. /// The degree of the root to be computed. /// The -th root of . - public static BigRational Root(BigRational x, int n) + public static BigRational RootN(BigRational x, int n) { return Root(x, n, MaxDigits); } @@ -1121,6 +1121,18 @@ public static (BigRational Sin, BigRational Cos) SinCos(BigRational x) { return (Sin(x, MaxDigits), Cos(x, MaxDigits)); //todo: opt. cpu } + /// Computes the sine and cosine of a value. + /// + /// This computes (sin(x * π), cos(x * π)).
+ /// Part of the new NET 7 number type system see .
+ /// The desired precision can preset by + ///
+ /// The value, in radians, whose sine and cosine are to be computed. + /// The sine and cosine of . + public static (BigRational SinPi, BigRational CosPi) SinCosPi(BigRational x) + { + return (Sin(x * Pi(MaxDigits), MaxDigits), Cos(x * Pi(MaxDigits), MaxDigits)); //todo: opt. cpu + } /// Computes the arc-cosine of a value and divides the result by pi. /// /// This computes arccos(x) / π in the interval [-0.5, +0.5].
@@ -1220,6 +1232,14 @@ public static BigRational Atan2Pi(BigRational y, BigRational x) return Atan2(y, x, MaxDigits) / Pi(MaxDigits); //todo: opt. cpu } + // IFloatingPointConstants + /// + static BigRational IFloatingPointConstants.Pi => Pi(); + /// + static BigRational IFloatingPointConstants.Tau => Tau(); + /// + static BigRational IFloatingPointConstants.E => throw new NotImplementedException(); + // IFloatingPointIeee754 (double compat.) /// Computes the integer logarithm of a value. ///