https://kotlinlang.org logo
#stdlib
Title
# stdlib
g

guenther

11/15/2018, 12:56 PM
In the Stdlib the companion of
Byte
looks like this:
Copy code
public class Byte private constructor() : Number(), Comparable<Byte> {
    companion object {
        public const val MIN_VALUE: Byte = -128
        public const val MAX_VALUE: Byte = 127
...
Double
on the other hand looks like this:
Copy code
public class Double private constructor() : Number(), Comparable<Double> {
    companion object {
        public val MIN_VALUE: Double
        public val MAX_VALUE: Double
...
Is there are a particular reason, why the properties in
Double
are not
const
? This prevents me to use those properties in my own constants.
🤔 3
s

spand

11/15/2018, 2:30 PM
Seems non trivial to find a valid kotlin double expression that is the max value
c

cbruegg

11/15/2018, 4:28 PM
@spand Why? 1.7976931348623157E308 is a valid Kotlin expression
s

spand

11/15/2018, 5:00 PM
Didn’t equal max value when I tried but maybe I made a mistake
c

cbruegg

11/15/2018, 5:01 PM
That's weird, this is what println(Double.MAX_VALUE) gave me
s

spand

11/15/2018, 5:01 PM
Not at a computer but should be easy to check :-)
3 Views