• 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: Absolute Value |x - y|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Absolute Value |x - y|


  • Subject: Re: Absolute Value |x - y|
  • From: Gregory Weston <email@hidden>
  • Date: Sat, 4 Dec 2004 15:56:36 -0500

On Dec 4, 2004, at 2:18 PM, Malte wrote:

i've been looking around trying to find a method that calculates the
|absolute value| of a number.
Without success.
Does anyone know if such a function exists?

They do, but you're probably better off just writing

T abs = ((x<y) ? (y-x) : (x-y));

where T is whatever type you need the result to be.

G

_______________________________________________
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


  • Follow-Ups:
    • Re: Absolute Value |x - y|
      • From: Frederick Cheung <email@hidden>
    • Re: Absolute Value |x - y|
      • From: Malte <email@hidden>
  • Prev by Date: Bindings granularity
  • Next by Date: Re: Problems with NSApplication Delegates
  • Previous by thread: Re: Absolute Value |x - y|
  • Next by thread: Re: Absolute Value |x - y|
  • Index(es):
    • Date
    • Thread