Bernhard
08/08/2024, 2:37 PMephemient
08/08/2024, 2:40 PMhho
08/08/2024, 2:41 PMMath.ceil(5.toDouble() / 3).toInt()
?ephemient
08/08/2024, 2:41 PMephemient
08/08/2024, 2:41 PMSam
08/08/2024, 2:42 PMBernhard
08/08/2024, 2:43 PMBernhard
08/08/2024, 2:43 PMephemient
08/08/2024, 3:47 PM/
means "float division regardless of types" and //
means "integer division regardless of types".
Kotlin is typed, so /
means "float division" on floats and "integer division" on ints.ephemient
08/08/2024, 3:49 PMkotlin.math.ceil(Double)
has to return a Double
because its range is larger than a Long
can contain (not a concern in Python since it has an arbitrary-precision integer falllback, but that has a cost throughout the rest of the language runtime)