-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabs.cs
More file actions
92 lines (68 loc) · 2.44 KB
/
abs.cs
File metadata and controls
92 lines (68 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Numerics;
#if WITH_NAME_SPACE
namespace CScripting
{
#endif
public partial class CScripting
{
#region abs
//public const double e = Math.E;
public const double pi = Math.PI;
/// <summary>
/// 将复数转为绝对值
/// </summary>
/// <param name="num"></param>
/// <returns></returns>
public static double Abs(Complex num) => Abs(num.Magnitude);
/// <see cref=" Math.Abs"/>
public static decimal Abs(decimal value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static double Abs(double value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static short Abs(short value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static int Abs(int value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static long Abs(long value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static sbyte Abs(sbyte value) => Abs(value);
/// <see cref=" Math.Abs"/>
public static float Abs(float value) => Abs(value);
#if OBSOLETE
[Obsolete("This method is deprecated, use `Abs` instead.")]
#endif
public static double abs(Complex num) => Math.Abs(num.Magnitude);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static double abs(double num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static decimal abs(decimal num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static short abs(short num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static int abs(int num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static long abs(long num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static sbyte abs(sbyte num) => Math.Abs(num);
#if OBSOLETE
[Obsolete("This method is deprecated, `using static System.Math;` and use `Abs` instead.")]
#endif
public static float abs(float num) => Math.Abs(num);
#endregion
}
#if WITH_NAME_SPACE
}
#endif