home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / cmlmcmpw.sit / Caml Light / Lib / float.mli < prev    next >
Encoding:
Text File  |  1991-05-01  |  2.8 KB  |  62 lines  |  [TEXT/MPS ]

  1. (* Operations of floating-point numbers *)
  2.  
  3. value int_of_float : float -> int = 1 "int_of_float"
  4.         (* Truncates the given float to an integer value.
  5.            The result is unspecified if if falls outside the
  6.            range of integers. *)
  7.   and float_of_int : int -> float = 1 "float_of_int";;
  8.         (* Converts an integer to floating-point. *)
  9.  
  10. value minus : float -> float = 1 "~float"
  11.   and minus_float : float -> float = 1 "~float"
  12.         (* Unary negation. *)
  13.   and prefix + : float -> float -> float = 2 "+float"
  14.   and add_float : float -> float -> float = 2 "+float"
  15.         (* Addition *)
  16.   and prefix - : float -> float -> float = 2 "-float"
  17.   and sub_float : float -> float -> float = 2 "-float"
  18.         (* Substraction *)
  19.   and prefix * : float -> float -> float = 2 "*float"
  20.   and mult_float : float -> float -> float = 2 "*float"
  21.         (* Product *)
  22.   and prefix / : float -> float -> float = 2 "/"
  23.   and div_float : float -> float -> float = 2 "/"
  24.         (* Division. The result is unpredictable if the dividend is 0.0. *)
  25.   and prefix = : float -> float -> bool = 2 "=float"
  26.   and eq_float : float -> float -> bool = 2 "=float"
  27.         (* Floating-point equality.
  28.            Equivalent to generic equality, just faster. *)
  29.   and prefix <> : float -> float -> bool = 2 "<>float"
  30.   and neq_float : float -> float -> bool = 2 "<>float"
  31.         (* Negation of the above. *)
  32.   and prefix < : float -> float -> bool = 2 "<float"
  33.   and lt_float : float -> float -> bool = 2 "<float"
  34.   and prefix > : float -> float -> bool = 2 ">float"
  35.   and gt_float : float -> float -> bool = 2 ">float"
  36.   and prefix <= : float -> float -> bool = 2 "<=float"
  37.   and le_float : float -> float -> bool = 2 "<=float"
  38.   and prefix >= : float -> float -> bool = 2 ">=float"
  39.   and ge_float : float -> float -> bool = 2 ">=float"
  40.         (* Usual comparisons between floating-point numbers. *)
  41. ;;
  42.  
  43. value string_of_float : float -> string = 1 "string_of_float" "alloc"
  44.         (* Converts the given float to its decimal representation *)
  45.   and float_of_string : string -> float = 1 "float_of_string"
  46.         (* Converts the given string to a float, in decimal.
  47.            The result is unspecified if the given string is not
  48.            a valid representation of an integer. *)
  49.   and exp : float -> float = 1 "exp_float"
  50.   and log : float -> float = 1 "log_float"
  51.   and sqrt : float -> float = 1 "sqrt_float"
  52.   and power : float -> float -> float = 2 "power_float"
  53.   and sin : float -> float = 1 "sin_float"
  54.   and cos : float -> float = 1 "cos_float"
  55.   and tan : float -> float = 1 "tan_float"
  56.   and asin : float -> float = 1 "asin_float"
  57.   and acos : float -> float = 1 "acos_float"
  58.   and atan : float -> float = 1 "atan_float"
  59.   and atan2 : float -> float -> float = 2 "atan2_float"
  60.           (* Usual transcendental functions on floating-point numbers. *)
  61. ;;
  62.