English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Arg-module: Float-Args also accept integer values
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-09 (03:25)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: Re: [Caml-list] Arg-module: Float-Args also accept integer values
> ===========================================
> first:~ oliver$ ocaml
>         Objective Caml version 3.09.2
> 
> # let floatingpoint_id (x:float) = x;;
> val floatingpoint_id : float -> float = <fun>
> # floatingpoint_id 42;;
> This expression has type int but is here used with type float
> # 
> ===========================================

float_of_string doesn't use the ocaml type system ;-) Don't know about 
impl details, but it's basically like atof (or whatever it's called) in 
standard C libs. The two are completely separate.

Jonathan