The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

Show your WorkFrom the old forum

Sign Node

No replies yet

  1. Attached is a very simple but occasionally useful node: sign.

    Sign returns the sign of a number: -1 if the number is negative, +1 if the number is positive, or 0 if the number is 0 (or -0).

    This comes in handy every now and then. It's not terribly hard to compute from scratch, but you do have to beware of those negative zeros which sometimes appear. So it's easier to copy paste this node than to reinvent that wheel each time. Most languages have this function. Now we do too.

    Sign will be included in the upcoming 3.2 rev of my library - coming soon!

    John

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply