Module Builtin.ArithOp
exceptionTypeMismatch of stringThis exception is raised when Arith functions are called on non-numeric values
type arith_view=[|`Int of Z.t|`Rat of Q.t|`Other of t]
val view : t -> arith_viewArith centered view of symbols
val parse_num : string -> tval sign : t -> intval one_i : tval zero_i : tval one_rat : tval zero_rat : tval zero_of_ty : [< `Int | `Rat ] -> tval one_of_ty : [< `Int | `Rat ] -> tval is_zero : t -> boolval is_one : t -> boolval is_minus_one : t -> boolval floor : t -> tval ceiling : t -> tval truncate : t -> tval round : t -> tval prec : t -> tval succ : t -> tval sum : t -> t -> tval difference : t -> t -> tval uminus : t -> tval product : t -> t -> tval quotient : t -> t -> tval quotient_e : t -> t -> tval quotient_t : t -> t -> tval quotient_f : t -> t -> tval remainder_e : t -> t -> tval remainder_t : t -> t -> tval remainder_f : t -> t -> tval to_int : t -> tval to_rat : t -> tval abs : t -> tval divides : t -> t -> boolval gcd : t -> t -> tval lcm : t -> t -> tval less : t -> t -> boolval lesseq : t -> t -> boolval greater : t -> t -> boolval greatereq : t -> t -> boolval divisors : Z.t -> Z.t listList of non-trivial strict divisors of the int.
- returns
if int <= 1, the list of divisors otherwise. Empty list for prime numbers, obviously.