Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: -- (:)
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:  FAQ:
To unsubscribe, mail  Archives: