Is this C code:
/* LERP(a,b,c) = linear interpolation macro, is 'a' when c == 0.0 and 'b' when c == 1.0 */
#define LERP(a,b,c) (((b) - (a)) * (c) + (a))
http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_T.html
Equals this C# code?
private static double LERP(double a, double b, double c) { return (((b) - (a)) * (c) + (a)); }
?
no.
consider the following:
LERP(x++,1,2);The c code might also have a side effect of increasing x twice [it is undefined as mentioned by @phresnel], while the c# code is perfectly defined, and will increase x only once.
the result also might be different, since the first
aand the second one [in the macro] might have a different value, since it might have increased in the first one.