I suggest we ...

Please make correct type casting for bigint in F#

I have been using the forward pipe to convert values and came up against the problem where the following code would work

let IntToFloat = 10 |> float
let FloatToInt = 10.0 |> int

But the equivalent bigint code would not work:
let FloatToBigint = 10.0 |> bigint

The reason why FloatToBignint does not compile is because the F# compiler is looking for a function called bigint that has an input of type float!

So, as soon as I had the following function declared:
let bigint(x:float) = bigint(x)

the code:
let FloatToBigint = 10.0 |> bigint
works perfectly.

Please make correct type casting for bigint in F# in order to eliminate the need to declare a helper function.

8 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
Alexei Odeychuk shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...

F# Language

Feedback and Knowledge Base