How do I check if a number is positive or negative in C#?
This is the industry standard:
int is_negative(float num) { char *p = (char*) malloc(20); sprintf(p, "%f", num); return p[0] == '-'; }