Repository navigation
Expand file tree
/
Copy pathMath.fs
More file actions
113 lines (106 loc) · 5.1 KB
/
Copy pathMath.fs
File metadata and controls
113 lines (106 loc) · 5.1 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/// Type bindings for Python math module: https://docs.python.org/3/library/math.html
module Fable.Python.Math
open System
open Fable.Core
// fsharplint:disable MemberNames
[<Erase>]
type IExports =
/// Return the ceiling of x as an integer
/// See https://docs.python.org/3/library/math.html#math.ceil
abstract ceil: x: int -> int
/// Return the ceiling of x as an integer
/// See https://docs.python.org/3/library/math.html#math.ceil
abstract ceil: x: float -> int
/// Return the number of ways to choose k items from n items (n choose k)
/// See https://docs.python.org/3/library/math.html#math.comb
abstract comb: n: int -> k: int -> int
/// Return a float with the magnitude of x and the sign of y
/// See https://docs.python.org/3/library/math.html#math.copysign
abstract copysign: x: float -> y: int -> float
/// Return the absolute value of x
/// See https://docs.python.org/3/library/math.html#math.fabs
abstract fabs: x: float -> float
/// Return the factorial of x
/// See https://docs.python.org/3/library/math.html#math.factorial
abstract factorial: x: float -> float
/// Return the floor of x as an integer
/// See https://docs.python.org/3/library/math.html#math.floor
abstract floor: x: int -> int
/// Return the floor of x as an integer
/// See https://docs.python.org/3/library/math.html#math.floor
abstract floor: x: float -> int
/// Return the remainder of x / y
/// See https://docs.python.org/3/library/math.html#math.fmod
abstract fmod: x: int -> y: int -> int
/// Return the greatest common divisor of the integers
/// See https://docs.python.org/3/library/math.html#math.gcd
abstract gcd: [<ParamArray>] ints: int[] -> int
/// Check if x is neither an infinity nor a NaN
/// See https://docs.python.org/3/library/math.html#math.isfinite
abstract isfinite: x: float -> bool
/// Check if x is neither an infinity nor a NaN
/// See https://docs.python.org/3/library/math.html#math.isfinite
abstract isfinite: x: int -> bool
/// Check if x is a positive or negative infinity
/// See https://docs.python.org/3/library/math.html#math.isinf
abstract isinf: x: float -> bool
/// Check if x is a positive or negative infinity
/// See https://docs.python.org/3/library/math.html#math.isinf
abstract isinf: x: int -> bool
/// Check if x is a NaN (not a number)
/// See https://docs.python.org/3/library/math.html#math.isnan
abstract isnan: x: float -> bool
/// Check if x is a NaN (not a number)
/// See https://docs.python.org/3/library/math.html#math.isnan
abstract isnan: x: int -> bool
/// Return the least common multiple of the integers
/// See https://docs.python.org/3/library/math.html#math.lcm
abstract lcm: [<ParamArray>] ints: int[] -> int
/// Return e raised to the power of x
/// See https://docs.python.org/3/library/math.html#math.exp
abstract exp: x: float -> float
/// Return e**x - 1, computed in a way that is accurate for small x
/// See https://docs.python.org/3/library/math.html#math.expm1
abstract expm1: x: float -> float
/// Return the natural logarithm of x
/// See https://docs.python.org/3/library/math.html#math.log
abstract log: x: float -> float
/// Return the natural logarithm of 1+x (base e)
/// See https://docs.python.org/3/library/math.html#math.log1p
abstract log1p: x: float -> float
/// Return the base-2 logarithm of x
/// See https://docs.python.org/3/library/math.html#math.log2
abstract log2: x: float -> float
/// Return the base-10 logarithm of x
/// See https://docs.python.org/3/library/math.html#math.log10
abstract log10: x: float -> float
/// Return x raised to the power y
/// See https://docs.python.org/3/library/math.html#math.pow
abstract pow: x: float -> y: float -> float
/// Return the arc cosine of x in radians
/// See https://docs.python.org/3/library/math.html#math.acos
abstract acos: x: float -> float
/// Return the arc sine of x in radians
/// See https://docs.python.org/3/library/math.html#math.asin
abstract asin: x: float -> float
/// Return the arc tangent of x in radians
/// See https://docs.python.org/3/library/math.html#math.atan
abstract atan: x: float -> float
/// Return the arc tangent of y/x in radians
/// See https://docs.python.org/3/library/math.html#math.atan2
abstract atan2: y: float -> x: float -> float
/// Return the cosine of x radians
/// See https://docs.python.org/3/library/math.html#math.cos
abstract cos: x: float -> float
/// Return the Euclidean distance between two points
/// See https://docs.python.org/3/library/math.html#math.dist
abstract dist: p: float -> q: float -> float
/// Return the sine of x radians
/// See https://docs.python.org/3/library/math.html#math.sin
abstract sin: x: float -> float
/// Return the tangent of x radians
/// See https://docs.python.org/3/library/math.html#math.tan
abstract tan: x: float -> float
/// Mathematical functions
[<ImportAll("math")>]
let math: IExports = nativeOnly