1
0
Fork 0

Nasal math module: Add math.sign -> math.sgn alias

This commit is contained in:
TheFGFSEagle 2023-09-20 00:45:06 +02:00
parent ee14849016
commit 72d9aef42b

View file

@ -1,6 +1,7 @@
var abs = func(n) { n < 0 ? -n : n } var abs = func(n) { n < 0 ? -n : n }
var sgn = func(x) { x < 0 ? -1 : x > 0 } var sgn = func(x) { x < 0 ? -1 : x > 0 }
var sign = sgn;
var max = func(x) { var max = func(x) {
var n = x; var n = x;
@ -46,4 +47,4 @@ var log10 = func(x) { ln(x) * _iln10 }
var approx_eq = func (a,b, d = 0.000001) { var approx_eq = func (a,b, d = 0.000001) {
return (abs(a-b) < d); return (abs(a-b) < d);
} }