https://kotlinlang.org logo
Title
r

Ruckus

03/11/2019, 6:56 PM
In the docs for
kotlin.math.ceil()
it says it returns:
the smallest double value that is greater than the given value
x
and is a mathematical integer
Shouldn't it say:
the smallest double value that is greater than or equal to the given value
x
and is a mathematical integer
(similar with
floor
, but obviously the other way around)
EDIT: The documentation is actually correct, I just need to learn to read (thanks @karelpeeters)
k

karelpeeters

03/11/2019, 7:16 PM
You could argue that the documentation is correct, it just treats integers as a special case:
Special cases:
-
ceil(x)
is
x
where
x
is
NaN
or
+Inf
or
-Inf
or already a mathematical integer.
But I agree that it's confusing.
or already a mathematical integer
r

Ruckus

03/11/2019, 7:19 PM
Sorry, my mistake, I see what you mean
i

ilya.gorbunov

03/20/2019, 6:15 PM
We'll clarify summary so that it is clear without delving into special cases. https://youtrack.jetbrains.com/issue/KT-30418
👍 2