I'm searching through the code for hard coded constants..........

I hope everybody is aware that math.h (C), and it's successor, cmath 
(C++) contains #defines for just about every irrational constant you 
might require defined out to the limits of machine precision...

For example, the code:

y = x / 1.44;

should be written as:

y = X * M_SQRT1_2;

since dividing something is equivalent to multiplying by it's 
reciprocal, and since the designers of C++ thoughtfully included the 
reciprocal as a constant, and because multiplication is a faster 
operation, this is the preferred method. =)

-- 
Ron Paul: A man of Peace.
Chemistry.com: A total rip-off.
Powers are not rights.
We did not invade Iraq, the government did.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Ktechlab-devel mailing list
Ktechlab-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ktechlab-devel

Reply via email to