Yes, sorry - i meant /usr/include/math.h

Because CGFloat is typedef'd to float on 32bit and double on 64bit i
have to swap between, eg,  atan and atanf depending on my build
settings. I have a framework which is intended to support 32bit and
64bit.

I thought this may have been a common scenario and some useful macros
might already exist.
Thanks

On 10 August 2010 14:10, lbland <lbl...@vvi.com> wrote:
> hi-
>
> On Aug 10, 2010, at 8:42 AM, steven Hooley wrote:
>
>> Is there a preferred way to use the Math.h functions with CGFloats
>> that is 32 and 64 bit safe?
>> Do some Macros already exist somewhere?
>>
>> Should i even be using Math.h functions in Cocoa?
>
> What do you mean by Math.h ? Do you mean: math.h (/usr/include/math.h) ?
>
> You can use math.h in Cocoa.
>
> math.h is a C standard and doesn't know about CGFloat (except that CGFloat is 
> typedef to double or float). math.h functions generally take doubles (with 
> implicit promotion of floats), or you can use the float counterpart (such as 
> cos() v.s. cosf() ).
>
> thanks!-
>
> -lance
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to