Sign Helper Function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2022
05:59 AM
I'm an instructor.
I would like a sign() helper function. It returns +1 if number is positive, -1 if number is negative and 0 if number is 0.
The formula x/abs(x) works pretty good, except if x = 0.