Commit e46bc118 authored by Benoit Barbot's avatar Benoit Barbot
Browse files

prog

parent 804f049b
Pipeline #981 passed with stage
in 30 seconds
...@@ -81,7 +81,20 @@ let float_buff b pos = ...@@ -81,7 +81,20 @@ let float_buff b pos =
let p,f = int_buff b pos in let p,f = int_buff b pos in
p, ((float_of_int f) /. 100.) p, ((float_of_int f) /. 100.)
(*let _ =
let check f =
let t = Buffer.create 10 in
buff_float t f;
let str = (Bytes.to_string @@ Buffer.to_bytes t) in
print_buff str;
let p1,f1= float_buff str 0 in
print_endline (string_of_float f);
print_endline (string_of_float f1);
assert(f1=f);;
check (10000.0)
let _ =
let t = Buffer.create 100 in let t = Buffer.create 100 in
for i = -1025 to 1020 do for i = -1025 to 1020 do
buff_int t i; buff_int t i;
...@@ -94,7 +107,7 @@ let float_buff b pos = ...@@ -94,7 +107,7 @@ let float_buff b pos =
let p1,i1= int_buff str !pos in let p1,i1= int_buff str !pos in
pos := p1; pos := p1;
print_endline (string_of_int i1); print_endline (string_of_int i1);
done*) done
let buff_string b str = let buff_string b str =
let n = String.length str in let n = String.length str in
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment