Jump to content

Real constants and functions: Difference between revisions

added ocaml
m (Added link to trig functions...combine?)
(added ocaml)
Line 31:
Math.floor(x); //floor
Math.ceil(x); //ceiling
Math.pow(x,y); //power</java>
 
=={{header|OCaml}}==
Unless otherwise noted, the following functions are for floats only:
<ocaml>sqrt x;; (* square root *)
log x;; (* natural logarithm--log base 10 also available (log10) *)
exp x;; (* exponential *)
abs_float x;; (* absolute value *)
abs x;; (* absolute value (for integers) *)
floor x;; (* floor *)
ceil x;; (* ceiling *)
x ** y; (* power *)</ocaml>
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.