2007-07-09 Mark Probst <mark.probst@gmail.com>
[mono.git] / mono / mini / basic-float.cs
index 6dadc5aaef0141211a6f8557ee50e3a5d8468c09..fb731f687789ef1547c1504cd5221dba3eab6fde 100644 (file)
@@ -192,6 +192,20 @@ class Tests {
                return 4;
        }
 
+       static int test_4_single_long_cast () {
+               long a = 1000;
+               float d = (float)a;
+               long b = (long)d;
+               if (b != 1000)
+                       return 0;
+               a = -1;
+               d = (float)a;
+               b = (long)d;
+               if (b != -1)
+                       return 1;
+               return 4;
+       }
+
        public static int test_0_rounding () {
                long ticks = 631502475130080000L;
                long ticksperday = 864000000000L;
@@ -534,5 +548,13 @@ class Tests {
                return result;
        }
 
+       static int test_0_float_precision () {
+               float f1 = 3.40282346638528859E+38f;
+               float f2 = 3.40282346638528859E+38f;            
+               float PositiveInfinity =  1.0f / 0.0f;
+               float f = f1 + f2;
+
+               return f == PositiveInfinity ? 0 : 1;
+       }
 }