-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmathx.logic.double.cs
238 lines (214 loc) · 16 KB
/
mathx.logic.double.cs
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
#region Header
// ** Copyright (C) 2023 Nicolas Reinhard, @LTMX. All rights reserved.
// ** Github Profile: https://github.com/LTMX
// ** Repository : https://github.com/LTMX/Unity.mathx
#endregion
using MI = System.Runtime.CompilerServices.MethodImplAttribute;
namespace Unity.Mathematics
{
public static partial class mathx
{
/// Returns true if a is odd
[MI(IL)] public static bool odd(this double a) => ((int)a & 1) != 0;
/// Returns true if a is odd component-wise
[MI(IL)] public static bool2 odd(this double2 a) => ((int2)a & 1) != 0;
/// Returns true if a is odd component-wise
[MI(IL)] public static bool3 odd(this double3 a) => ((int3)a & 1) != 0;
/// Returns true if a is odd component-wise
[MI(IL)] public static bool4 odd(this double4 a) => ((int4)a & 1) != 0;
/// Returns true if a is even
[MI(IL)] public static bool even(this double a) => ((int)a & 1) != 1;
/// Returns true if a is even component-wise
[MI(IL)] public static bool2 even(this double2 a) => ((int2)a & 1) != 1;
/// Returns true if a is even component-wise
[MI(IL)] public static bool3 even(this double3 a) => ((int3)a & 1) != 1;
/// Returns true if a is even component-wise
[MI(IL)] public static bool4 even(this double4 a) => ((int4)a & 1) != 1;
/// <inheritdoc cref="math.isnan(double4)"/>
[MI(IL)] public static bool4 isnan(this double4 f) => math.isnan(f);
/// <inheritdoc cref="math.isnan(double4)"/>
[MI(IL)] public static bool3 isnan(this double3 f) => math.isnan(f);
/// <inheritdoc cref="math.isnan(double4)"/>
[MI(IL)] public static bool2 isnan(this double2 f) => math.isnan(f);
/// <inheritdoc cref="math.isnan(double4)"/>
[MI(IL)] public static bool isnan(this double f) => math.isnan(f);
/// returns true if the any component is NAN, otherwise false
[MI(IL)] public static bool anynan(this double4 f) => f.x.isnan() || f.y.isnan() || f.z.isnan() || f.w.isnan();
/// returns true if the any component is NAN, otherwise false
[MI(IL)] public static bool anynan(this double3 f) => f.x.isnan() || f.y.isnan() || f.z.isnan();
/// returns true if the any component is NAN, otherwise false
[MI(IL)] public static bool anynan(this double2 f) => f.x.isnan() || f.y.isnan();
/// <inheritdoc cref="math.isinf(double4)"/>
[MI(IL)] public static bool4 isinf(this double4 f) => math.isinf(f);
/// <inheritdoc cref="math.isinf(double4)"/>
[MI(IL)] public static bool3 isinf(this double3 f) => math.isinf(f);
/// <inheritdoc cref="math.isinf(double4)"/>
[MI(IL)] public static bool2 isinf(this double2 f) => math.isinf(f);
/// <inheritdoc cref="math.isinf(double4)"/>
[MI(IL)] public static bool isinf(this double f) => math.isinf(f);
/// <inheritdoc cref="math.isfinite(double4)"/>
[MI(IL)] public static bool4 isfinite(this double4 f) => math.isfinite(f);
/// <inheritdoc cref="math.isfinite(double4)"/>
[MI(IL)] public static bool3 isfinite(this double3 f) => math.isfinite(f);
/// <inheritdoc cref="math.isfinite(double4)"/>
[MI(IL)] public static bool2 isfinite(this double2 f) => math.isfinite(f);
/// <inheritdoc cref="math.isfinite(double4)"/>
[MI(IL)] public static bool isfinite(this double f) => math.isfinite(f);
/// returns true component-wise if the any component is greater to the other value, otherwise false
[MI(IL)] public static bool4 greater(this double4 f, double value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool3 greater(this double3 f, double value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool2 greater(this double2 f, double value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool greater(this double f, double value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool4 greater(this double4 f, double4 value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool3 greater(this double3 f, double3 value) => f > value;
/// <inheritdoc cref="greater(double4,double)"/>
[MI(IL)] public static bool2 greater(this double2 f, double2 value) => f > value;
/// returns true component-wise if the any component is less to the other value, otherwise false
[MI(IL)] public static bool4 less(this double4 f, double value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool3 less(this double3 f, double value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool2 less(this double2 f, double value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool less(this double f, double value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool4 less(this double4 f, double4 value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool3 less(this double3 f, double3 value) => f < value;
/// <inheritdoc cref="less(double4,double)"/>
[MI(IL)] public static bool2 less(this double2 f, double2 value) => f < value;
/// returns true component-wise if the any component is less or equal to the other value, otherwise false
[MI(IL)] public static bool4 lesseq(this double4 f, double value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool3 lesseq(this double3 f, double value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool2 lesseq(this double2 f, double value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool lesseq(this double f, double value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool4 lesseq(this double4 f, double4 value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool3 lesseq(this double3 f, double3 value) => f <= value;
/// <inheritdoc cref="lesseq(double4,double)"/>
[MI(IL)] public static bool2 lesseq(this double2 f, double2 value) => f <= value;
/// returns true component-wise if the any component is greater or equal to the other value, otherwise false
[MI(IL)] public static bool4 greatereq(this double4 f, double value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool3 greatereq(this double3 f, double value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool2 greatereq(this double2 f, double value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool greatereq(this double f, double value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool4 greatereq(this double4 f, double4 value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool3 greatereq(this double3 f, double3 value) => f >= value;
/// <inheritdoc cref="greatereq(double4,double)"/>
[MI(IL)] public static bool2 greatereq(this double2 f, double2 value) => f >= value;
/// returns true component-wise if the any component is equal to the other value, otherwise false
[MI(IL)] public static bool4 eq(this double4 f, double value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool3 eq(this double3 f, double value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool2 eq(this double2 f, double value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool eq(this double f, double value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool4 eq(this double4 f, double4 value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool3 eq(this double3 f, double3 value) => f == value;
/// <inheritdoc cref="eq(double4,double)"/>
[MI(IL)] public static bool2 eq(this double2 f, double2 value) => f == value;
/// returns true component-wise if the any component is not equal to the other value, otherwise false
[MI(IL)] public static bool4 neq(this double4 f, double value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool3 neq(this double3 f, double value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool2 neq(this double2 f, double value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool neq(this double f, double value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool4 neq(this double4 f, double4 value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool3 neq(this double3 f, double3 value) => f != value;
/// <inheritdoc cref="neq(double4,double)"/>
[MI(IL)] public static bool2 neq(this double2 f, double2 value) => f != value;
/// returns true if the any component is greater to the other value, otherwise false
[MI(IL)] public static bool anygreater(this double4 f, double v) => f.x > v || f.y > v || f.z > v || f.w > v;
/// <inheritdoc cref="anygreater(double4,double)"/>
[MI(IL)] public static bool anygreater(this double3 f, double v) => f.x > v || f.y > v || f.z > v;
/// <inheritdoc cref="anygreater(double4,double)"/>
[MI(IL)] public static bool anygreater(this double2 f, double v) => f.x > v || f.y > v;
/// <inheritdoc cref="anygreater(double4,double)"/>
[MI(IL)] public static bool anygreater(this double4 f, double4 v) => f.x > v.x || f.y > v.y || f.z > v.z || f.z > v.z || f.w > v.w;
/// <inheritdoc cref="anygreater(double4,double)"/>
[MI(IL)] public static bool anygreater(this double3 f, double3 v) => f.x > v.x || f.y > v.y || f.z > v.z || f.z > v.z;
/// <inheritdoc cref="anygreater(double4,double)"/>
[MI(IL)] public static bool anygreater(this double2 f, double2 v) => f.x > v.x || f.y > v.y;
/// returns true if the any component is greater or equal to the other value, otherwise false
[MI(IL)] public static bool anygreatereq(this double4 f, double v) => f.x >= v || f.y >= v || f.z >= v || f.w >= v;
/// <inheritdoc cref="anygreatereq(double4,double)"/>
[MI(IL)] public static bool anygreatereq(this double3 f, double v) => f.x >= v || f.y >= v || f.z >= v;
/// <inheritdoc cref="anygreatereq(double4,double)"/>
[MI(IL)] public static bool anygreatereq(this double2 f, double v) => f.x >= v || f.y >= v;
/// <inheritdoc cref="anygreatereq(double4,double)"/>
[MI(IL)] public static bool anygreatereq(this double4 f, double4 v) => f.x >= v.x || f.y >= v.y || f.z >= v.z || f.w >= v.w;
/// <inheritdoc cref="anygreatereq(double4,double)"/>
[MI(IL)] public static bool anygreatereq(this double3 f, double3 v) => f.x >= v.x || f.y >= v.y || f.z >= v.z;
/// <inheritdoc cref="anygreatereq(double4,double)"/>
[MI(IL)] public static bool anygreatereq(this double2 f, double2 v) => f.x >= v.x || f.y >= v.y;
/// returns true if the any component is less to the other value, otherwise false
[MI(IL)] public static bool anyless(this double4 f, double v) => f.x < v || f.y < v || f.z < v || f.w < v;
/// <inheritdoc cref="anyless(double4,double)"/>
[MI(IL)] public static bool anyless(this double3 f, double v) => f.x < v || f.y < v || f.z < v;
/// <inheritdoc cref="anyless(double4,double)"/>
[MI(IL)] public static bool anyless(this double2 f, double v) => f.x < v || f.y < v;
/// <inheritdoc cref="anyless(double4,double)"/>
[MI(IL)] public static bool anyless(this double4 f, double4 v) => f.x < v.x || f.y < v.y || f.z < v.z || f.w < v.w;
/// <inheritdoc cref="anyless(double4,double)"/>
[MI(IL)] public static bool anyless(this double3 f, double3 v) => f.x < v.x || f.y < v.y || f.z < v.z;
/// <inheritdoc cref="anyless(double4,double)"/>
[MI(IL)] public static bool anyless(this double2 f, double2 v) => f.x < v.x || f.y < v.y;
/// returns true if the any component is less or equal to the other value, otherwise false
[MI(IL)] public static bool anylesseq(this double4 f, double v) => f.x <= v || f.y <= v || f.z <= v || f.w <= v;
/// <inheritdoc cref="anylesseq(double4,double)"/>
[MI(IL)] public static bool anylesseq(this double3 f, double v) => f.x <= v || f.y <= v || f.z <= v;
/// <inheritdoc cref="anylesseq(double4,double)"/>
[MI(IL)] public static bool anylesseq(this double2 f, double v) => f.x <= v || f.y <= v;
/// <inheritdoc cref="anylesseq(double4,double)"/>
[MI(IL)] public static bool anylesseq(this double4 f, double4 v) => f.x <= v.x || f.y <= v.y || f.z <= v.z || f.w <= v.w;
/// <inheritdoc cref="anylesseq(double4,double)"/>
[MI(IL)] public static bool anylesseq(this double3 f, double3 v) => f.x <= v.x || f.y <= v.y || f.z <= v.z;
/// <inheritdoc cref="anylesseq(double4,double)"/>
[MI(IL)] public static bool anylesseq(this double2 f, double2 v) => f.x <= v.x || f.y <= v.y;
/// returns true if the any component is equal to the other value, otherwise false
[MI(IL)] public static bool anyeq(this double4 f, double v) => f.x == v || f.y == v || f.z == v || f.w == v;
/// <inheritdoc cref="anyeq(double4,double)"/>
[MI(IL)] public static bool anyeq(this double3 f, double v) => f.x == v || f.y == v || f.z == v;
/// <inheritdoc cref="anyeq(double4,double)"/>
[MI(IL)] public static bool anyeq(this double2 f, double v) => f.x == v || f.y == v;
/// <inheritdoc cref="anyeq(double4,double)"/>
[MI(IL)] public static bool anyeq(this double4 f, double4 v) => f.x == v.x || f.y == v.y || f.z == v.z || f.w == v.w;
/// <inheritdoc cref="anyeq(double4,double)"/>
[MI(IL)] public static bool anyeq(this double3 f, double3 v) => f.x == v.x || f.y == v.y || f.z == v.z;
/// <inheritdoc cref="anyeq(double4,double)"/>
[MI(IL)] public static bool anyeq(this double2 f, double2 v) => f.x == v.x || f.y == v.y;
/// returns true if the any component is not equal to the other value, otherwise false
[MI(IL)] public static bool anyneq(this double4 f, double v) => f.x != v || f.y != v || f.z != v || f.w != v;
/// <inheritdoc cref="anyneq(double4,double)"/>
[MI(IL)] public static bool anyneq(this double3 f, double v) => f.x != v || f.y != v || f.z != v;
/// <inheritdoc cref="anyneq(double4,double)"/>
[MI(IL)] public static bool anyneq(this double2 f, double v) => f.x != v || f.y != v;
/// <inheritdoc cref="anyneq(double4,double)"/>
[MI(IL)] public static bool anyneq(this double4 f, double4 v) => f.x != v.x || f.y != v.y || f.z != v.z || f.w != v.w;
/// <inheritdoc cref="anyneq(double4,double)"/>
[MI(IL)] public static bool anyneq(this double3 f, double3 v) => f.x != v.x || f.y != v.y || f.z != v.z;
/// <inheritdoc cref="anyneq(double4,double)"/>
[MI(IL)] public static bool anyneq(this double2 f, double2 v) => f.x != v.x || f.y != v.y;
}
}