File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,9 @@ let aux_list loc ls =
92
92
eq loc (sl a ) b
93
93
) ls
94
94
#if OCAML_VERSION =~ " >4.03.0" then
95
- let () =
96
- aux_list __LOC__ [
95
+
96
+ let literals =
97
+ [
97
98
0x3 .fp+ 1 , " 0x1.f8p+2" (* (1. +. 0xf8p0 /. 0x1_00p0) *. 4.*) ;
98
99
0.3 , " 0x1.3333333333333p-2" ;
99
100
infinity, " infinity" ;
@@ -105,10 +106,23 @@ let () =
105
106
0.9 , " 0x1.ccccccccccccdp-1" ;
106
107
]
107
108
109
+ let () =
110
+ aux_list __LOC__ literals
111
+
108
112
let () =
109
113
eq __LOC__ (Printf. sprintf " %H" 0x3 .fp+ 1 ) " 0X1.F8P+2"
114
+ let scan_float loc s expect =
115
+ Scanf. sscanf s " %h" (fun result -> eq loc result expect)
116
+
117
+ let () =
118
+ scan_float __LOC__ " 0x3f.p1" 0x3f .p1;
119
+ scan_float __LOC__ " 0x1.3333333333333p-2" 0.3 ;
120
+ List. iter (fun (a ,b ) ->
121
+ scan_float __LOC__ b a
122
+ ) literals
110
123
#end
111
124
125
+
112
126
#if
113
127
(* OCAML_VERSION =~ ">4.03.0" *) 0
114
128
then
You can’t perform that action at this time.
0 commit comments