Re: Re: "make positive" function
Re: Re: "make positive" function
- Subject: Re: Re: "make positive" function
- From: "Shawn Erickson" <email@hidden>
- Date: Mon, 11 Sep 2006 11:48:38 -0700
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 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).
Also not clear if he wants an integer (int) at the end of this or
not... which he can get from casting of course.
-Shawn
_______________________________________________
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