Yeah, I think you're right. Unless I'm just getting confused, Dynamic C appears to be doing the same thing.

One solution :

#define LOG log10 //lib is wrong

#define LOG10 log //lib is wrong

Now when I use LOG(x) it replaces it with log10(x). LOG10(x) is replaced by log(x)

I was a little suprised that this worked. It's a little anal, but it might save me some head scratching if I need to go back and trouble shoot the algorithm sometime in the future.

I would be careful with such a definition.

If someone else is likely to work on your program in the future, it is a sure method to spell disaster.

It would be extremely confusing to define the natural log, Log

_{e}(x) to be written as Log10(x).

If ln(x) is not used elsewhere, you might choose to define it as your natural log function.

Then you would merely define log(x) and log10(x) as meaning the same thing. Or... you could define log10(x) to throw an error so you could remember what you had done.