mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-07 03:35:38 -05:00
fix compilation after rebase
This commit is contained in:
parent
9d3da47f3b
commit
dbba6719bc
3 changed files with 14 additions and 2 deletions
|
|
@ -45,6 +45,14 @@ module type RATIONAL = sig
|
|||
val num : t -> bigint
|
||||
val denum : t -> bigint
|
||||
|
||||
val infinity : t
|
||||
(** +infinity *)
|
||||
|
||||
val minus_infinity : t
|
||||
|
||||
val is_real : t -> bool
|
||||
(** A proper real, not nan/infinity *)
|
||||
|
||||
val pp_approx : int -> Format.formatter -> t -> unit
|
||||
(** Pretty print rational with given amount of precision
|
||||
(for example as a floating point number) *)
|
||||
|
|
|
|||
|
|
@ -217,8 +217,8 @@ module Make(Q : RATIONAL)(Var: VAR)
|
|||
let[@inline] (>=) a b = compare a b >= 0
|
||||
let[@inline] (=) a b = compare a b = 0
|
||||
|
||||
let plus_inf = make Q.inf Q.zero
|
||||
let minus_inf = make Q.minus_inf Q.zero
|
||||
let plus_inf = make Q.infinity Q.zero
|
||||
let minus_inf = make Q.minus_infinity Q.zero
|
||||
let[@inline] min x y = if x <= y then x else y
|
||||
let[@inline] max x y = if x >= y then x else y
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ module Rational
|
|||
let pp = pp_print
|
||||
let hash a = Hashtbl.hash (Z.hash (num a), Z.hash (den a))
|
||||
|
||||
let infinity = Q.inf
|
||||
let minus_infinity = Q.minus_inf
|
||||
let is_real = Q.is_real
|
||||
|
||||
let pp_approx n out q = Format.fprintf out "%*.1f" n (Q.to_float q)
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue