blob: c64faa6a6dd75085a3363ed04b777086415ca9a5 [file] [log] [blame]
/*
* Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
*/
/**
* @assertion It is a compile-time error if the unbounded integer value of a
* double valued integer literal cannot be represented exactly as an IEEE 754
* double-precision value, assuming that the mantissa is extended with zeros
* until the precision is sufficiently high to unambiguously specify a single
* integer value.
* @description Checks that it is a compile-time error if the unbounded positive
* integer value is less than (1−2^(−53))*2^1024 but hasn't the exact double
* value representation.
* The unbounded integer value of (1−2^(−53))*2^1024 - 1 hasn't the exact double
* value representation and its integer value is
* 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858367
* @compile-error
* @author ngl@unipro.ru
*/
double gd1 = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858367; //# 01: compile-time error
class C {
static double sd1 = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858367; //# 02: compile-time error
double id1 = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858367; //# 03: compile-time error
}
main() {
double ld1 = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858364; //# 04: compile-time error
new C();
}