0

I basically want to create an array (Array.array(k + 1, 1)) but because k is of type Int64 (it has to be), I can't create the array (gives error), so I am trying to find a way to bypass that error. Any Ideas?

P.s the values of k < 20000 but it has to be stored as Int64.int.

GSerg
  • 76,472
  • 17
  • 159
  • 346

1 Answers1

1

Just convert to an integer with Int64.toInt:

val k: Int64.int = ...
val a = Array.array (Int64.toInt k + 1, 1)
Sam Westrick
  • 1,248
  • 1
  • 7
  • 9