diff --git a/Makefile.generating b/Makefile.generating
index 12dd18b3f0afb4cb03bfaf8a9e8a9e682730a238..31a445a75ca111f32afc84a2b6a6748409d9436f 100644
--- a/Makefile.generating
+++ b/Makefile.generating
@@ -133,11 +133,23 @@ ifeq ($(HAS_OCAML408),yes)
         Format.String_tag str -> str \
       | _ -> raise (Invalid_argument "unsupported tag extension")
   FORMAT_STAG_OF_STRING=Format.String_tag s
+  HAS_OCAML407_OR_408=yes
 else
   DYNLINK_INIT=Dynlink.init
   FORMAT_STAG=tag
   FORMAT_STRING_OF_STAG=s
   FORMAT_STAG_OF_STRING=s
+  ifeq ($(HAS_OCAML407),yes)
+    HAS_OCAML407_OR_408=yes
+  else
+    HAS_OCAML407_OR_408=no
+  endif
+endif
+
+ifeq ($(HAS_OCAML407_OR_408),yes)
+  FLOAT_MAX_FLOAT=Float.max_float
+else
+  FLOAT_MAX_FLOAT=Pervasives.max_float
 endif
 
 src/libraries/stdlib/transitioning.ml: \
@@ -153,6 +165,7 @@ src/libraries/stdlib/transitioning.ml: \
          -e 's/@ASSOC_OPT@/$(ASSOC_OPT)/g' \
          -e 's/@ASSQ_OPT@/$(ASSQ_OPT)/g' \
          -e 's/@DYNLINK_INIT@/$(DYNLINK_INIT)/g' \
+         -e 's/@FLOAT_MAX_FLOAT@/$(FLOAT_MAX_FLOAT)/g' \
          -e 's/@FORMAT_STAG@/$(FORMAT_STAG)/g' \
          -e 's/@FORMAT_STRING_OF_STAG@/$(FORMAT_STRING_OF_STAG)/g' \
          -e 's/@FORMAT_STAG_OF_STRING@/$(FORMAT_STAG_OF_STRING)/g' \
diff --git a/src/libraries/stdlib/transitioning.ml.in b/src/libraries/stdlib/transitioning.ml.in
index de6215991de78ead186f5deb8cca34095989fb99..cf09ddd667ed096ced79582ad7905f8ddc82ed19 100644
--- a/src/libraries/stdlib/transitioning.ml.in
+++ b/src/libraries/stdlib/transitioning.ml.in
@@ -37,6 +37,10 @@ module Dynlink = struct
   let init = @DYNLINK_INIT@
 end
 
+module Float = struct
+  let max_float = @FLOAT_MAX_FLOAT@
+end
+
 module Format = struct
   type stag = Format.@FORMAT_STAG@
   let string_of_stag s = @FORMAT_STRING_OF_STAG@
diff --git a/src/libraries/stdlib/transitioning.mli b/src/libraries/stdlib/transitioning.mli
index 521cf30c013bf939d5bbecc4444a682620267319..94ae54311a9ca97d31b0eab45927b7d4454c96c8 100644
--- a/src/libraries/stdlib/transitioning.mli
+++ b/src/libraries/stdlib/transitioning.mli
@@ -49,6 +49,11 @@ module Dynlink: sig
   val init: unit -> unit
 end
 
+(** 4.07 *)
+module Float: sig
+  val max_float: float
+end
+
 (** 4.08 *)
 module Format: sig
   type stag