 # Thread: is there a simple equation to turn any number into -1, 1, or 0?

1. ## is there a simple equation to turn any number into -1, 1, or 0?

Is there a simple equation to turn any number into -1, 1, or 0? Essentially, I just want to be able to deduce whether a number is positive or negative. But without using a condition - instead, using an equation that I can use in an expression.

I'm sure there must be some simple equation that will take -2, -94, and -2234234.12 and return -1 (or 2, 94, and 22343234.12, and return 1), but I can't think of one because my maths is pretty poor.  Reply With Quote

2. n / abs( n )  Reply With Quote

3. of course! thanks edit: though I guess if n is 0, that produces a division by 0. How does Fusion handle div by 0? Would it just return 0, or would it likely break something?  Reply With Quote

4. It would just return "0".  Reply With Quote

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•