Commit 7a0e25dd authored by Benoit Barbot's avatar Benoit Barbot
Browse files

p

parent 30459d5f
Pipeline #1322 passed with stage
in 38 seconds
......@@ -32,6 +32,11 @@ let rot rho (x,y) =
let pi = 4.0 *. atan 1.0
let angle (x,y) =
if x > 0.0 then atan (y/.x)
else if x < 0.0 then pi +. atan (y/.x)
else if y > 0.0 then pi/.2.0 else -.pi/.2.0
module Color = struct
type t = int*int*int
......@@ -116,11 +121,6 @@ let flipColor ctx =
setStrokeColor ctx fc;
setFillColor ctx sc
let angle (x,y) =
if x > 0.0 then atan (y/.x)
else if x < 0.0 then pi +. atan (y/.x)
else if y > 0.0 then pi/.2.0 else -.pi/.2.0
let solve_linear a b =
if a=0.0 then []
else [b/.a]
......
......@@ -81,19 +81,28 @@ let float_buff b pos =
let p,f = int_buff b pos in
p, ((float_of_int f) /. 100.)
(*let check f =
(*
let check i =
let t = Buffer.create 10 in
buff_float t f;
buff_int t i;
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);;
let p1,i1= int_buff str 0 in
if i<>i1 then (
print_buff str;
print_endline (string_of_int i);
print_endline (string_of_int i1);
assert false
);;
check (10000.0)
let _ =
let i = ref 0 in
while true do
check !i;
incr i;
done;;
check (10000)
let _ =
let t = Buffer.create 100 in
for i = -1025 to 1020 do
......
Markdown is supported
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