Re: "make positive" function
Re: "make positive" function
- Subject: Re: "make positive" function
- From: John Stiles <email@hidden>
- Date: Mon, 11 Sep 2006 12:03:15 -0700
On Sep 11, 2006, at 11:48 AM, Shawn Erickson wrote:
On 9/11/06, John Stiles <email@hidden> wrote:
#include <math.h>
void myFn()
{
//...
double positiveValue = floor( abs(value) + 0.5f );
}
Likely meant fabs(value) in the above
Right.
and not fully understanding what
the OP wants... use of round may be more correct (not clear if he
wants the closest greater than integer or just the closest integer).
Hmm, right, I think I stopped using round because it wasn't available
in Dev Studio. :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden