Fitch Posted May 26, 2004 Posted May 26, 2004 I have a calculation that works, but I'm thinking there's probably a more elegant solution: If( myNumber - 1 > 0, myNumber - 1, 0 ) I.e., I want to subtract one, but not go into negative numbers. Is there a clever-er calc for this?
The Shadow Posted May 26, 2004 Posted May 26, 2004 Max( myNumber-1; 0 ) is a little smaller, you might also save a few microseconds since the subtraction was only done once...
Fitch Posted May 26, 2004 Author Posted May 26, 2004 That looks right. I thought I'd looked at Max, but maybe it was Min I thought about and Min won't work. Thanks, Shad.
Recommended Posts
This topic is 7586 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now