In kotlin-multiplatform targeting js, Long values are represented as an object containing the top and bottom 32 bits of the value as separate fields ({low: lowbits, high: highbits, value: zzzzzzzzzz}) . Is there any way to hint to the compiler that the values are less than Number.MAX_SAFE_INTEGER, and that they should be represented in javascript as a bare Number, or to otherwise pass a number greater than 1<<31 back into native javascript code?
c
christophsturm
11/13/2020, 9:51 AM
why not use Int?
christophsturm
11/13/2020, 9:53 AM
on never mind, integers in js are bigger than ints in java and kotlin
p
Patrick Ramsey
04/16/2021, 2:56 AM
yupyup
Patrick Ramsey
04/16/2021, 2:56 AM
or rather, js doesn’t have integers. It has doubles, only.