Lite-C has some eccentricities. The compiler probably does not understand your casts.

Just make pointers to double and dereference them in your comparisons.