The Crystal Programming Language Forum

C integration with Int128

I am picking up an old project it is a c integration.
It normally returns an Int128 I want to cast this to a Slice of Bytes.

Is this even possible with the Current Crystal?

I guess I’d do:

n = 1234567890.to_i128
p pointerof(n).as(UInt8*).to_slice(16)
1 Like

So I think Int128 are really Int64s right now until Int128 are fully implemented in the compiler.

Int128 is really Int128, except that it’s not supported in some platforms, and there’s no way to specify literals for them (among other things).

1 Like