[Bf-committers] Why not use sqrtf instead of sqrt?

Kent Mein bf-committers@blender.org
Fri, 18 Jun 2004 15:07:21 -0500


In reply to Panagiotis Papadakos (papadako@csd.uoc.gr):

> Since in many cases sqrt is used for float numbers, I think it should be
> replaced by sqrtf, which would make the code cleaner (no casting) and
> should also be faster in some systems! Any comments?
> 

Well under solaris I don't think there is a sqrtf so we'd have to do
some nasty stuff that would result in uglier code.

maybe a typedef in some header for SQRTF SQRTL etc....

If you do a search through the board about the comments you'll see the
changes I had to do on solaris and a note that was gcc specific.
If you were using solaris's native compiler which I am slowly trying
to get working btw... You'd have to do something different.
I'm not sure what that is exactly at this stage, my gut tells me
sqrt is just overloaded with solaris's compiler and it figures it out
automatically.

Kent
-- 
mein@cs.umn.edu
http://www.cs.umn.edu/~mein