RE: why here a int and not a float ?
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <[email protected]> |
Thanks, This did the trick : let multiply_ten x = x *. 10.0 Roelof > To: [email protected] > From: [email protected] > Date: Sun, 22 Feb 2015 15:52:09 +0100 > Subject: Re: "ocaml_beginners"::[] why here a int and not a float ? > > > > > I know that and according to the page you linked to * is Always a int. > > But my question stays. How can I tell Ocaml when I make a function that > > it has to use floats instead of int. > > > > You can use * for int and *. for float. > > Actualy, each function for int exists for float by adding a « . » to the > operator. > > Take a look in pervasives[1] for the list. > > [1] http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html > > > ------------------------------------ > > ------------------------------------ > > Archives up to December 31, 2011 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr > Attachments are banned and you're asked to be polite, avoid flames etc. > ------------------------------------ > > Yahoo Groups Links > > >