--- In

ocaml_beginners@yahoogroups.com, "LORENZO" <arniwarp@...> wrote:

> What's infinity...??

A number that's too big to be represented by

ocaml floats (see the OCaml manual, in

Pervasives > Floating-point arithmetic : this is

the "IEEE 754 standard").

> Any good suggestions for my foolish trial?

Foolish indeed : The number

N=987654321^987654321 has

8883560462 digits, and the maximum string

length (Sys.max_string_length) is

16777211 (on my toplevel). So the number

is more than 800 times too long to be written out,

let alone be computed.

Otherwise, you can use the Num module (or

the Big_int module which is more specifically made

for integers):

# #load "nums.cma";;

# let self_power x=

let b_x=Big_int.big_int_of_string(x) in

let b_answer=Big_int.power_big_int_positive_big_int(b_x)(b_x) in

Big_int.string_of_big_int b_answer;;

val self_power : string -> string = <fun>

# let trial=self_power "987654321";;

Out of memory during evaluation. // see ? I told ya !

HTH,

Ewan