Nasal math module: Add math.sign -> math.sgn alias
This commit is contained in:
parent
ee14849016
commit
72d9aef42b
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
var abs = func(n) { n < 0 ? -n : n }
|
||||
|
||||
var sgn = func(x) { x < 0 ? -1 : x > 0 }
|
||||
var sign = sgn;
|
||||
|
||||
var max = func(x) {
|
||||
var n = x;
|
||||
|
@ -46,4 +47,4 @@ var log10 = func(x) { ln(x) * _iln10 }
|
|||
|
||||
var approx_eq = func (a,b, d = 0.000001) {
|
||||
return (abs(a-b) < d);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue