INTEGER_LITERAL_IMPRECISE_AS_DOUBLE constant

CompileTimeErrorCode const INTEGER_LITERAL_IMPRECISE_AS_DOUBLE

An integer literal with static type double and numeric value i evaluates to an instance of the double class representing the value i. It is a compile-time error if the value i cannot be represented precisely by the an instace of double.

Implementation

static const CompileTimeErrorCode INTEGER_LITERAL_IMPRECISE_AS_DOUBLE =
    CompileTimeErrorCode(
        'INTEGER_LITERAL_IMPRECISE_AS_DOUBLE',
        "The integer literal is being used as a double, but can't be "
            "represented as a 64 bit double without overflow and/or loss of "
            "precision: {0}",
        correction:
            "Try using the BigInt class, or switch to the closest valid "
            "double: {1}")