Properly handle i32.trunc_f64_s of -2147483648.x (#1225)

Fixes #1224

Add testing for other values that seem too big to be
converted, but are ok after rounding. This is the only
one that was a spec interpreter bug. I wrote those
tests in a simple way with .9 values, replacing
the .9999999 from earlier - as @binji said, we should
either use hex-float notation, or avoid testing the parser
at the same time. As the issue here is rounding, I think
it's clearest to add .9 which suggests "this should be
rounded away".
diff --git a/interpreter/exec/i32_convert.ml b/interpreter/exec/i32_convert.ml
index 482783a..05814fa 100644
--- a/interpreter/exec/i32_convert.ml
+++ b/interpreter/exec/i32_convert.ml
@@ -27,7 +27,7 @@
     raise Numeric_error.InvalidConversionToInteger
   else
     let xf = F64.to_float x in
-    if xf >= -.Int32.(to_float min_int) || xf < Int32.(to_float min_int) then
+    if xf >= -.Int32.(to_float min_int) || xf <= Int32.(to_float min_int) -. 1.0 then
       raise Numeric_error.IntegerOverflow
     else
       Int32.of_float xf
diff --git a/test/core/conversions.wast b/test/core/conversions.wast
index cfd65a3..65d0933 100644
--- a/test/core/conversions.wast
+++ b/test/core/conversions.wast
@@ -120,8 +120,8 @@
 (assert_return (invoke "i32.trunc_f64_s" (f64.const -2.0)) (i32.const -2))
 (assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.0)) (i32.const 2147483647))
 (assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.0)) (i32.const -2147483648))
-(assert_return (invoke "i32.trunc_f64_s" (f64.const 2147483647.9999998)) (i32.const 2147483647))
-(assert_trap   (invoke "i32.trunc_f64_s" (f64.const 2147483647.9999999)) "integer overflow")
+(assert_return (invoke "i32.trunc_f64_s" (f64.const -2147483648.9)) (i32.const -2147483648))
+(assert_return (invoke "i32.trunc_f64_s" (f64.const  2147483647.9)) (i32.const  2147483647))
 (assert_trap (invoke "i32.trunc_f64_s" (f64.const 2147483648.0)) "integer overflow")
 (assert_trap (invoke "i32.trunc_f64_s" (f64.const -2147483649.0)) "integer overflow")
 (assert_trap (invoke "i32.trunc_f64_s" (f64.const inf)) "integer overflow")
@@ -145,6 +145,8 @@
 (assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.ccccccccccccdp-1)) (i32.const 0))
 (assert_return (invoke "i32.trunc_f64_u" (f64.const -0x1.fffffffffffffp-1)) (i32.const 0))
 (assert_return (invoke "i32.trunc_f64_u" (f64.const 1e8)) (i32.const 100000000))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const -0.9)) (i32.const 0))
+(assert_return (invoke "i32.trunc_f64_u" (f64.const 4294967295.9)) (i32.const 4294967295))
 (assert_trap (invoke "i32.trunc_f64_u" (f64.const 4294967296.0)) "integer overflow")
 (assert_trap (invoke "i32.trunc_f64_u" (f64.const -1.0)) "integer overflow")
 (assert_trap (invoke "i32.trunc_f64_u" (f64.const 1e16)) "integer overflow")