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
[Caml-list] Newbie question about type (and syntax?)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-06-25 (19:51)
From: Johann Spies <jhspies@a...>
Subject: [Caml-list] Newbie question about type (and syntax?)
I am working through a tutorial and typing in the following example
produced an error:

let rec power i x =
        if i = 0 then
        x *. (power (i-1) x);;
This expression has type float but is here used with type int

I can not see why it is an error and how to correct the code coming
from the tutorial.

Can somebody help me please?
J.H. Spies - Tel. 082 782 0336.  Posbus 4668, Tygervallei 7536
     "Honour thy father and mother; which is the first  
      commandment with promise; That it may be well with 
      thee, and thou mayest live long on the earth."        
                          Ephesians 6:2,3 
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr