Project

General

Profile

Revision 9a9058f4 src/corelang.ml

View differences:

src/corelang.ml
516 516
 List.sort (fun (t, _) (t', _) -> compare t t') hl
517 517

  
518 518
let num_10 = Num.num_of_int 10
519
  
519

  
520
let cst_real_to_num n i =
521
  Num.(n // (num_10 **/ (num_of_int i)))
522

  
520 523
let rec is_eq_const c1 c2 =
521 524
  match c1, c2 with
522 525
  | Const_real (n1, i1, _), Const_real (n2, i2, _)
523
    -> Num.(let n1 = n1 // (num_10 **/ (num_of_int i1)) in
524
	    let n2 = n2 // (num_10 **/ (num_of_int i2)) in
525
	    eq_num n1 n2)
526
    -> let n1 = cst_real_to_num n1 i1 in
527
       let n2 = cst_real_to_num n2 i2 in
528
	    Num.eq_num n1 n2
526 529
  | Const_struct lcl1, Const_struct lcl2
527 530
    -> List.length lcl1 = List.length lcl2
528 531
    && List.for_all2 (fun (l1, c1) (l2, c2) -> l1 = l2 && is_eq_const c1 c2) lcl1 lcl2

Also available in: Unified diff