forked from melilly/Gravitational-Wave-Toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FunctionList.txt
81 lines (50 loc) · 2.93 KB
/
FunctionList.txt
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
Function list Press Ctrl + F on Windows, Linux or Command + F on Mac to search for the function you need
abs(x) - returns the absolute value of a
math.acos(x) - returns angle in radians for inverse cosine
math.asin(x) - returns angle in radians for inverse sine
math.atan(x) - returns angle in radians for inverse tangent
math.ceil(x) - rounds x upwards to the nearest integer
math.cos(x) - returns cos of x (x is in radians)
math.degrees(x) - converts radians to degrees
math.e - Euler's number
math.exp(x) - returns e**x, the exponential function of x
math.fabs(x) - returns the absolute value of x as a decimal
math.factorial(x)
math.floor(x) - rounds x downward to the nearest integer
len('x') - returns length of string, beginning at zero
math.log(x) - returns the natural log of x
math.log(x, base) - returns the log of x for the given base
max(a,b,c,....) - returns the largest number
min(a,b,c…..) - returns the smallest number
math.pi - mathematical constant pi
pow(a,b) - Returns a to the power of b
(also same as a ** b)
math.radians(x) - converts degrees to radians
random.randint(a,b) - produces a random number between a and b
round(a, b) - returns a decimal value rounded to b digits after decimal point
math.sin(x) - returns sin of x (x is in radians)
math.sqrt(x) - returns square root of x, as a float
math.tan(x) - returns tangent of x (x is in radians)
Syntax List
+ add two integers, floats, or strings
- subtract two integers or floats
** raise to the power of ( 3**2 = 9 )
/ divides with floats (includes decimal places)
// divides with integers (chops off remainder)
% (modulus) returns the remainder of a division (34 % 10 = 4)
not takes the opposite; used in boolean expressions
and evaluates to true if BOTH conditions are met ( "3==2 and 2==2" evaluates false); used in boolean
or evaluates to true if AT LEAST ONE condition is met ( "3==2 and 2==2" evaluates true); used in boolean
< less than
<= less than or equal to
> more than
>= more than or equal to
== equal to
!= not equal to
= assigns a value. x = 2
+= assigns the left side to the SUM of the left and right sides ( a+=2 is the same as a=a+2)
-= assigns the left side to the DIFFERENCE of the left and right sides (a-=2 is the same as a=a-2)
*= assigns the left side to the PRODUCT of the left and right sides (a*=2 is the same as a=a*2)
/= assigns the left side to the QUOTIENT (with decimals) of the left and right sides (a/=2 is the same as a=a/2)
//= assigns the left side to the QUOTIENT (no decimals) of the left and right sides (a//=2 is the same as a=a//2)
%= assigns the left side to the MODULUS of the left and right sides (a%=2 is the same as a=a%2)