~In the docs for `kotlin.math.ceil()` it says it r...
# announcements
r
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
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
Sorry, my mistake, I see what you mean
i
We'll clarify summary so that it is clear without delving into special cases. https://youtrack.jetbrains.com/issue/KT-30418
👍 2