double safe?

Official forum for the Chipmunk2D Physics Library.
Post Reply
debug
Posts: 19
Joined: Sun Nov 23, 2008 4:42 pm
Contact:

double safe?

Post by debug »

I see lots of use of

fabsf
fmodf

instead of

fabs
fmod

this will cast the cpFloat to a float before doing the math and return a float which is then cast back into a double if cpFloat is type def as double which it was in 4.1.0 release
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: double safe?

Post by slembcke »

It's a known issue. Haven't quite decided what to do about it yet.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
debug
Posts: 19
Joined: Sun Nov 23, 2008 4:42 pm
Contact:

Re: double safe?

Post by debug »

Since those functions are just wrappers and it ends up as a double anyway just before it goes to the cpu it is probably worth just using the non "f" versions in release mode it will become intrinsic or heavily inlined anyway so you won't loose anything and the non "f" versions work fine with floats.
Christopher1
Posts: 2
Joined: Tue Feb 17, 2009 2:08 am
Contact:

Re: double safe?

Post by Christopher1 »

F versions normally wok with floats than non f versions,,,,
[url=http://www.southcoastrecovery.com/]drug rehab[/url]
Post Reply

Who is online

Users browsing this forum: No registered users and 26 guests