(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                            XML Query Engine                         *)
(*                                                                     *)
(*  Copyright 2000, Lucent Technologies.                               *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: decimal.mli,v 1.1 2002/10/27 20:02:52 simeon Exp $ *)

(* Note:
     This modules implement internal support for the XML Schema
     primitive simple type decimal, and the corresponding derived types.
   - Jerome
 *)

(*********************************************************)
(* Internal representation of decimals and derived types *)
(*********************************************************)

type _decimal  = Num.num
type _integer  = Big_int.big_int
type _int      = int

(*************************)
(* Operations on decimal *)
(*************************)

val _decimal_zero : _decimal

val _decimal_of_string : string -> _decimal
val _string_of_decimal : _decimal -> string

val _decimal_eq : _decimal -> _decimal -> bool
val _decimal_lt : _decimal -> _decimal -> bool
val _decimal_le : _decimal -> _decimal -> bool
val _decimal_gt : _decimal -> _decimal -> bool
val _decimal_ge : _decimal -> _decimal -> bool
val _decimal_add  : _decimal -> _decimal -> _decimal
val _decimal_sub  : _decimal -> _decimal -> _decimal
val _decimal_mult : _decimal -> _decimal -> _decimal
val _decimal_div  : _decimal -> _decimal -> _decimal
val _decimal_mod  : _decimal -> _decimal -> _decimal
val _decimal_unary_minus  : _decimal -> _decimal

val _decimal_of_integer : _integer -> _decimal
val _decimal_of_int     : _int     -> _decimal

(*************************)
(* Operations on integer *)
(*************************)

val _integer_zero : _integer

val _integer_of_string : string -> _integer
val _string_of_integer : _integer -> string

val _integer_eq : _integer -> _integer -> bool
val _integer_lt : _integer -> _integer -> bool
val _integer_le : _integer -> _integer -> bool
val _integer_gt : _integer -> _integer -> bool
val _integer_ge : _integer -> _integer -> bool
val _integer_add  : _integer -> _integer -> _integer
val _integer_sub  : _integer -> _integer -> _integer
val _integer_mult : _integer -> _integer -> _integer
val _integer_div  : _integer -> _integer -> _integer
val _integer_mod  : _integer -> _integer -> _integer
val _integer_unary_minus  : _integer -> _integer

val _integer_of_decimal : _decimal -> _integer
val _integer_of_int     : _int     -> _integer

(*********************)
(* Operations on int *)
(*********************)

val _int_zero : _int

val _int_of_string : string -> _int
val _string_of_int : _int -> string

val _int_eq : _int -> _int -> bool
val _int_lt : _int -> _int -> bool
val _int_le : _int -> _int -> bool
val _int_gt : _int -> _int -> bool
val _int_ge : _int -> _int -> bool
val _int_add  : _int -> _int -> _int
val _int_sub  : _int -> _int -> _int
val _int_mult : _int -> _int -> _int
val _int_div  : _int -> _int -> _int
val _int_mod  : _int -> _int -> _int
val _int_unary_minus  : _int -> _int

val _int_of_decimal     : _decimal -> _int
val _int_of_integer     : _integer -> _int

