get greatest prime factor in F#
Posted
by
Alex
on Stack Overflow
See other posts from Stack Overflow
or by Alex
Published on 2012-07-01T15:12:29Z
Indexed on
2012/07/01
15:15 UTC
Read the original article
Hit count: 163
F#
I had VS 11 beta and the following code was working without problem:
let rec fac x y =
if (x = y) then y
elif (x % y = 0I) then fac (x / y) y
else fac x / (y + 1I);;
Now I installed VS 2012 RC and I get the following error:
The type 'System.Numerics.BigInteger -> System.Numerics.BigInteger' is not compatible with the type 'System.Numerics.BigInteger'
Is code not correct or F# interactive? It's F# 3.0.
© Stack Overflow or respective owner