Powershell中可以使用的.Net实用静态方法(powershell -enc)学到了吗

随心笔谈2年前发布 admin
196 0 0

文章摘要

文章介绍了System.Math类中的静态方法及其功能,这些方法主要用于数值计算。主要内容包括基本的数学运算,如绝对值、三角函数(如正弦、余弦、正切)、指数函数、对数函数、幂运算、比较运算以及取整和舍入运算等。文章详细列举了每个方法的定义和使用场景,例如Abs返回给定数值的绝对值,Acos返回余弦值的反余弦值,Exp返回e的指定次幂。文章还提到这些方法在编程中被广泛用于科学计算、游戏开发和工程建模等场景。通过这些方法,开发者可以根据需求进行精确的数值计算和处理。

PS> [Math] | Get-Member -MemberType *Method -Static

   TypeName: System.Math

Name            MemberType Definition                                                                                    

—-            ———- ———-                                                                                    

Abs             Method     static sbyte Abs(sbyte value), static int16 Abs(int16 value), static int Abs(int value), sta…

Acos            Method     static double Acos(double d)          

Asin            Method     static double Asin(double d)           

Atan            Method     static double Atan(double d)           

Atan2           Method     static double Atan2(double y, double x)

BigMul          Method     static long BigMul(int a, int b)  

Ceiling         Method     static decimal Ceiling(decimal d), static double Ceiling(double a)

Cos             Method     static double Cos(double d)

Cosh            Method     static double Cosh(double value                                                            

DivRem          Method     static int DivRem(int a, int b, [ref] int result), static long DivRem(long a, long b, [ref] …

Equals          Method     static bool Equals(System.Object objA, System.Object objB)

Exp             Method     static double Exp(double d)             

Floor           Method     static decimal Floor(decimal d), static double Floor(double d)

IEEERemainder   Method     static double IEEERemainder(double x, double y)

Log             Method     static double Log(double d), static double Log(double a, double newBase)

Log10           Method     static double Log10(double d)

Max             Method     static sbyte Max(sbyte val1, sbyte val2), static byte Max(byte val1, byte val2), static int1…

Min             Method     static sbyte Min(sbyte val1, sbyte val2), static byte Min(byte val1, byte val2), static int1…

Pow             Method     static double Pow(double x, double y)

ReferenceEquals Method     static bool ReferenceEquals(System.Object objA, System.Object objB)

Round           Method     static double Round(double a), static double Round(double value, int digits), static double …

Sign            Method     static int Sign(sbyte value), static int Sign(int16 value), static int Sign(int value), stat…

Sin             Method     static double Sin(double a)

Sinh            Method     static double Sinh(double value)  

Sqrt            Method     static double Sqrt(double d)

Tan             Method     static double Tan(double a)

Tanh            Method     static double Tanh(double value)

Truncate        Method     static decimal Truncate(decimal d), static double Truncate(double d)

© 版权声明

相关文章