• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "make positive" function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >"make positive" function (From: Mike Abdullah <email@hidden>)
 >Re: "make positive" function (From: John Stiles <email@hidden>)
 >Re: Re: "make positive" function (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: Re: clicking through
  • Next by Date: Re: "make positive" function
  • Previous by thread: Re: Re: "make positive" function
  • Next by thread: Re: "make positive" function
  • Index(es):
    • Date
    • Thread