Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGNUM function #1956

Closed
gabrielastro opened this issue Dec 20, 2024 · 2 comments · Fixed by #1966
Closed

SIGNUM function #1956

gabrielastro opened this issue Dec 20, 2024 · 2 comments · Fixed by #1966

Comments

@gabrielastro
Copy link

Hello, I cannot find the SIGNUM function, which returns the sign of its input (integer or double, scalar or vector, etc.). At https://comp.lang.idl-pvwave.narkive.com/jEV4l1KY/sign-function-signof-num-or-array-of-num, there are some versions provided, including the (expensive but robust?) following:

GDL> x = [ -2e4, 5, 0, 1d/0, -1d/0, 0d/0 ]
GDL> print, (x GT 0) -1* (x LT 0)
      -1       1       0       1      -1       0

Apparently, the SIGNUM function was introduced in IDL 8.3 (https://www.nv5geospatialsoftware.com/docs/SIGNUM.html). Maybe it could be a worthwhile addition at some point. Thank you!

@GillesDuvert
Copy link
Contributor

added in #1966

@gabrielastro
Copy link
Author

Merci beaucoup!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants