Sgn, Wrap and Constrain...

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Sgn, Wrap and Constrain...

Post by MrTAToad »

... are a few more procedures I would like to see

Sgn - return the sign of a number
Wrap - Wrap a number between two ranges
Contrain - Make sure a number cant exceed two ranges
Sirius-2337
Posts: 35
Joined: Wed Mar 26, 2014 5:47 pm

Re: Sgn, Wrap and Constrain...

Post by Sirius-2337 »

We already have sgn
Result.f = Sign(Number.f)

Returns a floating-point value representing the sign of the given number.

- Returns 0 if Number is zero.
- Returns 1 if Number is positive.
- Returns -1 if Number is negative.
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: Sgn, Wrap and Constrain...

Post by MrTAToad »

Was wondering why I couldn't find that...

Also Min and Max would be useful...
Post Reply