Browse thread
[Caml-list] Newbie question about type (and syntax?)
- Johann Spies
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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
1
else
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?
Johann
--
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