I understand that bigint
is not a function but rather a type constructor. That's why this fails:
// Won't compile
let foo = 10 |> bigint
I understand that I can create a new function which accepts an integer and returns a bigint
, and then the pipeline operator will work.
However, I don't understand why this works:
let bar = bigint 10
If bigint
is a type constructor, why don't I need new
? Where exactly is bigint
defined as an alias to System.Numerics.BigInteger's constructor?
The BIGINT data type is a machine-independent method for representing numbers in the range of -2 63-1 to 2 63-1. ESQL/C provides routines that facilitate the conversion from the BIGINT data type to other data types in the C language. The BIGINT data type is internally represented with the ifx_int8_t structure.
F# Data Types: int. An integer is a natural number that includes only digits and no other symbol. The F# languages supports various types of integers.
bigint is type abberviation for System.Numerics.BigInteger so when you type
let x = bigint 10
you actually create instance of BigInteger. In F# new is optional in constructors, basically it should be used when creating instances of types that implement IDisposable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With