Add new function - sgn(value) #118
config2000
started this conversation in
Polls
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
sgn() is a classic basic function that takes one parameter and returns it's sign according these rules:
it's useful for 'normalising' a value (for want of a better phrase) which can then be scaled back up.
The Javascript equivalent is Math.sign()
The sgn() can be done in microScript by using this function:
sgn=function(v) (v>0)-(v<0) end
4 votes ·
Beta Was this translation helpful? Give feedback.
All reactions