g

    guenther

    3 years ago
    In the Stdlib the companion of
    Byte
    looks like this:
    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:
    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.
    s

    spand

    3 years ago
    Seems non trivial to find a valid kotlin double expression that is the max value
    cbruegg

    cbruegg

    3 years ago
    @spand Why? 1.7976931348623157E308 is a valid Kotlin expression
    s

    spand

    3 years ago
    Didn’t equal max value when I tried but maybe I made a mistake
    cbruegg

    cbruegg

    3 years ago
    That's weird, this is what println(Double.MAX_VALUE) gave me
    s

    spand

    3 years ago
    Not at a computer but should be easy to check 😃