home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-01 | 2.8 KB | 62 lines | [TEXT/MPS ] |
- (* Operations of floating-point numbers *)
-
- value int_of_float : float -> int = 1 "int_of_float"
- (* Truncates the given float to an integer value.
- The result is unspecified if if falls outside the
- range of integers. *)
- and float_of_int : int -> float = 1 "float_of_int";;
- (* Converts an integer to floating-point. *)
-
- value minus : float -> float = 1 "~float"
- and minus_float : float -> float = 1 "~float"
- (* Unary negation. *)
- and prefix + : float -> float -> float = 2 "+float"
- and add_float : float -> float -> float = 2 "+float"
- (* Addition *)
- and prefix - : float -> float -> float = 2 "-float"
- and sub_float : float -> float -> float = 2 "-float"
- (* Substraction *)
- and prefix * : float -> float -> float = 2 "*float"
- and mult_float : float -> float -> float = 2 "*float"
- (* Product *)
- and prefix / : float -> float -> float = 2 "/"
- and div_float : float -> float -> float = 2 "/"
- (* Division. The result is unpredictable if the dividend is 0.0. *)
- and prefix = : float -> float -> bool = 2 "=float"
- and eq_float : float -> float -> bool = 2 "=float"
- (* Floating-point equality.
- Equivalent to generic equality, just faster. *)
- and prefix <> : float -> float -> bool = 2 "<>float"
- and neq_float : float -> float -> bool = 2 "<>float"
- (* Negation of the above. *)
- and prefix < : float -> float -> bool = 2 "<float"
- and lt_float : float -> float -> bool = 2 "<float"
- and prefix > : float -> float -> bool = 2 ">float"
- and gt_float : float -> float -> bool = 2 ">float"
- and prefix <= : float -> float -> bool = 2 "<=float"
- and le_float : float -> float -> bool = 2 "<=float"
- and prefix >= : float -> float -> bool = 2 ">=float"
- and ge_float : float -> float -> bool = 2 ">=float"
- (* Usual comparisons between floating-point numbers. *)
- ;;
-
- value string_of_float : float -> string = 1 "string_of_float" "alloc"
- (* Converts the given float to its decimal representation *)
- and float_of_string : string -> float = 1 "float_of_string"
- (* Converts the given string to a float, in decimal.
- The result is unspecified if the given string is not
- a valid representation of an integer. *)
- and exp : float -> float = 1 "exp_float"
- and log : float -> float = 1 "log_float"
- and sqrt : float -> float = 1 "sqrt_float"
- and power : float -> float -> float = 2 "power_float"
- and sin : float -> float = 1 "sin_float"
- and cos : float -> float = 1 "cos_float"
- and tan : float -> float = 1 "tan_float"
- and asin : float -> float = 1 "asin_float"
- and acos : float -> float = 1 "acos_float"
- and atan : float -> float = 1 "atan_float"
- and atan2 : float -> float -> float = 2 "atan2_float"
- (* Usual transcendental functions on floating-point numbers. *)
- ;;
-