FROM : Matthew Whillock
DATE : Mon Nov 17 13:23:56 2008
Have a look at:
http://en.wikipedia.org/wiki/Varargs
I know it's possible on linux/gcc so surely it works in osx.
Cheers,
Matt
>
> ------------------------------
>
> Message: 2
> Date: Mon, 17 Nov 2008 09:38:39 +0200
> From: "Oleg Krupnov" <oleg.<email_removed>>
> Subject: How to implement float min(float x, ...) ?
> To: "Cocoa-Dev List" <<email_removed>>
> Message-ID:
> <<email_removed>>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I apologize, this is plain old C, not Cocoa-specific question, but the
> fastest way to get the answer.
>
> I want to create a function that finds the minimum out of a
> variable-length list of simple float arguments. In other words, I want
> this function:
>
> float min(float x, ...);
>
> Can anyone suggest the implementation?
>
> I have read this: http://developer.apple.com/qa/qa2005/qa1405.html
> but it seems to address arguments of type "id", not sure it will work
> for simple integral types like float.
>
> Thanks!
--
Matthew Whillock
<email_removed>
http://www.mssl.ucl.ac.uk/
Mullard Space Science Laboratory
Department Of Space And Climate Physics
Holmbury St Mary
Surrey RH5 6NT
UK
DATE : Mon Nov 17 13:23:56 2008
Have a look at:
http://en.wikipedia.org/wiki/Varargs
I know it's possible on linux/gcc so surely it works in osx.
Cheers,
Matt
>
> ------------------------------
>
> Message: 2
> Date: Mon, 17 Nov 2008 09:38:39 +0200
> From: "Oleg Krupnov" <oleg.<email_removed>>
> Subject: How to implement float min(float x, ...) ?
> To: "Cocoa-Dev List" <<email_removed>>
> Message-ID:
> <<email_removed>>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I apologize, this is plain old C, not Cocoa-specific question, but the
> fastest way to get the answer.
>
> I want to create a function that finds the minimum out of a
> variable-length list of simple float arguments. In other words, I want
> this function:
>
> float min(float x, ...);
>
> Can anyone suggest the implementation?
>
> I have read this: http://developer.apple.com/qa/qa2005/qa1405.html
> but it seems to address arguments of type "id", not sure it will work
> for simple integral types like float.
>
> Thanks!
--
Matthew Whillock
<email_removed>
http://www.mssl.ucl.ac.uk/
Mullard Space Science Laboratory
Department Of Space And Climate Physics
Holmbury St Mary
Surrey RH5 6NT
UK
| Related mails | Author | Date |
|---|---|---|
| No related mails found. | ||






Cocoa mail archive

