aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/byterun/coq_float64.h4
-rw-r--r--kernel/nativevalues.ml6
2 files changed, 6 insertions, 4 deletions
diff --git a/kernel/byterun/coq_float64.h b/kernel/byterun/coq_float64.h
index 6814c31642..9fc390bd33 100644
--- a/kernel/byterun/coq_float64.h
+++ b/kernel/byterun/coq_float64.h
@@ -29,4 +29,8 @@ DECLARE_FUNOP(fsqrt, sqrt(x))
DECLARE_FUNOP(next_up, nextafter(x, INFINITY))
DECLARE_FUNOP(next_down, nextafter(x, -INFINITY))
+value coq_is_double(value x) {
+ return Val_long(Is_double(x));
+}
+
#endif /* _COQ_FLOAT64_ */
diff --git a/kernel/nativevalues.ml b/kernel/nativevalues.ml
index 1d4fb5d39c..6b9d49052d 100644
--- a/kernel/nativevalues.ml
+++ b/kernel/nativevalues.ml
@@ -517,10 +517,8 @@ let print x =
(** Support for machine floating point values *)
-let is_float (x:t) =
- let o = Obj.repr x in
- Int.equal (Obj.tag o) Obj.double_tag
-[@@ocaml.inline always]
+external is_float : t -> bool = "coq_is_double"
+[@@noalloc]
let to_float (x:t) = (Obj.magic x : Float64.t)
[@@ocaml.inline always]