[ODE] dCylinder and sqrtf on Mac OS X

Olivier Michel Olivier.Michel at cyberbotics.com
Mon Mar 24 01:54:02 2003


Ruud van Gaal wrote:

>>I had to change all the sqrtf() to sqrt() in dCylinder.cpp to get it 
>>compile on Mac OS X. Is there a missing include or magic define that 
>>could fix it ?
>>    
>>
>Please keep it at sqrtf() and define it to be sqrt() or something like that
>(provide a stub float sqrtf(float n)).
>sqrt() inputs a double, so sqrtf() can really be worthwhile when using
>floats, and when it's available (most systems have it now; even on MSVC7 I
>saw a cosf() today).
>
I do agree with you that we should not plain replace sqrtf by sqrt. 
However, using dSqrt, as sugguested by Konstantin, seems to be the best 
solution as it allows for either the float or double version to be used, 
depending on what was defined in the config file at build time.

-Olivier