diff --git a/source/nanoFramework.CoreLibrary/System/Math.cs b/source/nanoFramework.CoreLibrary/System/Math.cs index 76a4c7f5..a5919191 100644 --- a/source/nanoFramework.CoreLibrary/System/Math.cs +++ b/source/nanoFramework.CoreLibrary/System/Math.cs @@ -7,10 +7,15 @@ namespace System { using Runtime.CompilerServices; + /// /// Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions. /// - public static class Math + /// + /// Specific for nanoFramework: this class library is split between mscorlib and it's own assembly. + /// If you require any of the other methods that are not available here add the NuGet package nanoFramework.System.Math. + /// + public static partial class Math { /// /// Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. @@ -30,25 +35,7 @@ public static class Math /// A 32-bit signed integer, x, such that 0 ≤ x ≤ Int32..::..MaxValue. [MethodImpl(MethodImplOptions.InternalCall)] public static extern int Abs(int val); - - /// - /// Returns the larger of two 32-bit signed integers. - /// - /// The first of two 32-bit signed integers to compare. - /// The second of two 32-bit signed integers to compare. - /// Parameter val1 or val2, whichever is larger. - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int Max(int val1, int val2); - - /// - /// Returns the smaller of two 32-bit signed integers. - /// - /// The first of two 32-bit signed integers to compare. - /// The second of two 32-bit signed integers to compare. - /// Parameter val1 or val2, whichever is smaller. - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int Min(int val1, int val2); - + /// /// Returns the absolute value of a double-precision floating-point number. /// @@ -74,569 +61,22 @@ public static class Math public static extern float Abs(float val); /// - /// Returns the angle whose cosine is the specified number. - /// - /// A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1. - /// An angle, θ, measured in radians, such that 0 ≤ θ ≤ π -or- NaN if d < -1 or d > 1 or d equals NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Acos(double d); - /// - /// Returns the angle whose cosine is the specified number. - /// - /// A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1. - /// An angle, θ, measured in radians, such that 0 ≤ θ ≤ π -or- NaN if d < -1 or d > 1 or d equals NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Acos(float d); - - /// - /// Returns the angle whose sine is the specified number. - /// - /// A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1. - /// An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2 -or- NaN if d < -1 or d> 1 or d equals NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Asin(double d); - /// - /// Returns the angle whose sine is the specified number. - /// - /// A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1. - /// An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2 -or- NaN if d < -1 or d> 1 or d equals NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Asin(float d); - - /// - /// Returns the angle whose tangent is the specified number. - /// - /// A number representing a tangent. - /// An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- NaN if d equals NaN, -π/2 rounded to double precision(-1.5707963267949) if d equals NegativeInfinity, or π/2 rounded to double precision(1.5707963267949) if d equals PositiveInfinity. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Atan(double d); - /// - /// Returns the angle whose tangent is the specified number. - /// - /// A number representing a tangent. - /// An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. -or- NaN if d equals NaN, -π/2 rounded to double precision(-1.5707963267949) if d equals NegativeInfinity, or π/2 rounded to double precision(1.5707963267949) if d equals PositiveInfinity. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Atan(float d); - - /// - /// Returns the angle whose tangent is the quotient of two specified numbers. - /// - /// The y coordinate of a point. - /// The x coordinate of a point. - /// An angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Atan2(double y, double x); - /// - /// Returns the angle whose tangent is the quotient of two specified numbers. - /// - /// The y coordinate of a point. - /// The x coordinate of a point. - /// An angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Atan2(float y, float x); - - /// - /// Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number. - /// - /// A double-precision floating-point number. - /// The smallest integral value that is greater than or equal to d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned. Note that this method returns a Double instead of an integral type. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Ceiling(double d); - /// - /// Returns the smallest integral value that is greater than or equal to the specified single-precision floating-point number. - /// - /// A single-precision floating-point number. - /// The smallest integral value that is greater than or equal to d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned. Note that this method returns a Double instead of an integral type. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Ceiling(float d); - - /// - /// Returns the cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The cosine of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Cos(double a); - /// - /// Returns the cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The cosine of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Cos(float a); - - /// - /// Returns the hyperbolic cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The hyperbolic cosine of val. If val is equal to NegativeInfinity or PositiveInfinity, PositiveInfinity is returned. If value is equal to NaN, NaN is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Cosh(double a); - /// - /// Returns the hyperbolic cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The hyperbolic cosine of val. If val is equal to NegativeInfinity or PositiveInfinity, PositiveInfinity is returned. If value is equal to NaN, NaN is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Cosh(float a); - - /// - /// Returns the remainder resulting from the division of a specified number by another specified number. - /// - /// A dividend. - /// A divisor. - /// A number equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y falls halfway between two integers, the even integer is returned). - /// If x - (y Q) is zero, the value +0 is returned if x is positive, or -0 if x is negative. - /// If y = 0, NaN is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double IEEERemainder(double x, double y); - /// - /// Returns the remainder resulting from the division of a specified number by another specified number. - /// - /// A dividend. - /// A divisor. - /// A number equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y falls halfway between two integers, the even integer is returned). - /// If x - (y Q) is zero, the value +0 is returned if x is positive, or -0 if x is negative. - /// If y = 0, NaN is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float IEEERemainder(float x, float y); - - /// - /// Returns e raised to the specified power. - /// - /// A number specifying a power. - /// The number e raised to the power d. If d equals NaN or PositiveInfinity, that value is returned. If d equals NegativeInfinity, 0 is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Exp(double d); - /// - /// Returns e raised to the specified power. - /// - /// A number specifying a power. - /// The number e raised to the power d. If d equals NaN or PositiveInfinity, that value is returned. If d equals NegativeInfinity, 0 is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Exp(float d); - - /// - /// Returns the largest integer less than or equal to the specified double-precision floating-point number. - /// - /// A double-precision floating-point number. - /// The largest integer less than or equal to d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Floor(double d); - /// - /// Returns the largest integer less than or equal to the specified single-precision floating-point number. - /// - /// A single-precision floating-point number. - /// The largest integer less than or equal to d. If d is equal to NaN, NegativeInfinity, or PositiveInfinity, that value is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Floor(float d); - - /// - /// Returns the natural (base e) logarithm of a specified number. - /// - /// The number whose logarithm is to be found. - /// The natural logarithm of d; that is, ln d, or log e d - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Log(double d); - /// - /// Returns the natural (base e) logarithm of a specified number. - /// - /// The number whose logarithm is to be found. - /// The natural logarithm of d; that is, ln d, or log e d - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Log(float d); - - /// - /// Returns the base 10 logarithm of a specified number. - /// - /// A number whose logarithm is to be found. - /// The base 10 log of d; that is, log 10 d. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Log10(double d); - /// - /// Returns the base 10 logarithm of a specified number. - /// - /// A number whose logarithm is to be found. - /// The base 10 log of d; that is, log 10 d. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Log10(float d); - - /// - /// Returns the larger of two double-precision floating-point numbers. - /// - /// The first of two double-precision floating-point numbers to compare. - /// The second of two double-precision floating-point numbers to compare. - /// Parameter x or y, whichever is larger. If x, y, or both x and y are equal to NaN, NaN is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Max(double x, double y); - /// - /// Returns the larger of two single-precision floating-point numbers. - /// - /// The first of two single-precision floating-point numbers to compare. - /// The second of two single-precision floating-point numbers to compare. - /// Parameter x or y, whichever is larger. If x, y, or both x and y are equal to NaN, NaN is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Max(float x, float y); - - /// - /// Returns the smaller of two double-precision floating-point numbers. - /// - /// The first of two double-precision floating-point numbers to compare. - /// The second of two double-precision floating-point numbers to compare. - /// Parameter x or y, whichever is smaller. If x, y, or both x and y are equal to NaN, NaN is returned. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Min(double x, double y); - /// - /// Returns the smaller of two single-precision floating-point numbers. - /// - /// The first of two single-precision floating-point numbers to compare. - /// The second of two single-precision floating-point numbers to compare. - /// Parameter x or y, whichever is smaller. If x, y, or both x and y are equal to NaN, NaN is returned. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Min(float x, float y); - - /// - /// Returns a specified number raised to the specified power. - /// - /// A double-precision floating-point number to be raised to a power. - /// A double-precision floating-point number that specifies a power. - /// The number x raised to the power y. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Pow(double x, double y); - /// - /// Returns a specified number raised to the specified power. - /// - /// A single-precision floating-point number to be raised to a power. - /// A single-precision floating-point number that specifies a power. - /// The number x raised to the power y. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Pow(float x, float y); - - /// - /// Rounds a double-precision floating-point value to the nearest integral value. - /// - /// A double-precision floating-point number to be rounded. - /// The integer nearest d. If the fractional component of d is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns a Double instead of an integral type. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Round(double d); - /// - /// Rounds a single-precision floating-point value to the nearest integral value. - /// - /// A single-precision floating-point number to be rounded. - /// The integer nearest d. If the fractional component of d is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns a Double instead of an integral type. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Round(float d); - - /// - /// Returns a value indicating the sign of a double-precision floating-point number. - /// - /// A signed number. - /// A number that indicates the sign of value. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int Sign(double value); - /// - /// Returns a value indicating the sign of a single-precision floating-point number. - /// - /// A signed number. - /// A number that indicates the sign of value. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern int Sign(float value); - - /// - /// Returns the sine of the specified angle. - /// - /// An angle, measured in radians. - /// The sine of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Sin(double a); - /// - /// Returns the sine of the specified angle. - /// - /// An angle, measured in radians. - /// The sine of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Sin(float a); - - /// - /// Returns the hyperbolic sine of the specified angle. - /// - /// An angle, measured in radians. - /// The hyperbolic sine of value. If value is equal to NegativeInfinity, PositiveInfinity, or NaN, this method returns a Double equal to value. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Sinh(double value); - /// - /// Returns the hyperbolic sine of the specified angle. - /// - /// An angle, measured in radians. - /// The hyperbolic sine of value. If value is equal to NegativeInfinity, PositiveInfinity, or NaN, this method returns a Double equal to value. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Sinh(float value); - - /// - /// Returns the square root of a specified number. - /// - /// The number whose square root is to be found. - /// The positive square root of d. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Sqrt(double d); - /// - /// Returns the square root of a specified number. - /// - /// The number whose square root is to be found. - /// The positive square root of d. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Sqrt(float d); - - /// - /// Returns the tangent of the specified angle. - /// - /// An angle, measured in radians. - /// The tangent of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Tan(double a); - /// - /// Returns the tangent of the specified angle. + /// Returns the larger of two 32-bit signed integers. /// - /// An angle, measured in radians. - /// The tangent of a. If a is equal to NaN, NegativeInfinity, or PositiveInfinity, this method returns NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// + /// The first of two 32-bit signed integers to compare. + /// The second of two 32-bit signed integers to compare. + /// Parameter val1 or val2, whichever is larger. [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Tan(float a); + public static extern int Max(int val1, int val2); /// - /// Returns the hyperbolic tangent of the specified angle. - /// - /// An angle, measured in radians. - /// The hyperbolic tangent of value. If value is equal to NegativeInfinity, this method returns -1. If value is equal to PositiveInfinity, this method returns 1. If value is equal to NaN, this method returns NaN. - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Tanh(double value); - /// - /// Returns the hyperbolic tangent of the specified angle. + /// Returns the smaller of two 32-bit signed integers. /// - /// An angle, measured in radians. - /// The hyperbolic tangent of value. If value is equal to NegativeInfinity, this method returns -1. If value is equal to PositiveInfinity, this method returns 1. If value is equal to NaN, this method returns NaN. - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// + /// The first of two 32-bit signed integers to compare. + /// The second of two 32-bit signed integers to compare. + /// Parameter val1 or val2, whichever is smaller. [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Tanh(float value); + public static extern int Min(int val1, int val2); - /// - /// Calculates the integral part of a specified double-precision floating-point number. - /// - /// A number to truncate. - /// The integral part of d; that is, the number that remains after any fractional digits have been discarded - /// - /// This method with double-precision floating-point parameter might not be available in all platforms or with firmware images that where build with single point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern double Truncate(double d); - /// - /// Calculates the integral part of a specified single-precision floating-point number. - /// - /// A number to truncate. - /// The integral part of d; that is, the number that remains after any fractional digits have been discarded - /// - /// This method with single-precision floating-point parameter is exclusive of nanoFramework. It doesn't exist in the .NET API, only the double-precision floating-point version. - /// It might not be available in all platforms or with firmware images that where build with double point FPU option. - /// - /// - [MethodImpl(MethodImplOptions.InternalCall)] - public static extern float Truncate(float d); } }