public static int Sign (float value) { if (Single.IsNaN (value)) throw new ArithmeticException ("NAN"); if (value > 0) return 1; return (value == 0)? 0: -1; }