Reputation: 5546
I have Int
val y = 10
I want to cast to BigInt
y.toBigInt
it show error
<console>:26: error: value toBigInt is not a member of Int
y.toBigInt
How can I cast Int to BigInt ?
Upvotes: 0
Views: 7866
Reputation: 27356
All the obvious methods work. You can assign an Int
to a BigInt
, you can pass an Int
to a function that takes BigInt
, and you can just use BigInt(y)
.
Upvotes: 4