Files
sdk/pkg/linter/test_data/rules/avoid_js_rounded_ints.dart
T
pq 0742604758 clean up references to dart test
See: https://github.com/dart-lang/linter/issues/4754

Change-Id: Ib875e1640dd15f321362f2dba76b3d5d8524497c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/328183
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-09-27 21:54:09 +00:00

21 lines
713 B
Dart

// 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.
final i1 = 1; // OK
final i2 = -45321; // OK
final i3 = 24361; // OK
final i4 = 245452; // OK
final min = -9007199254740991; // OK
final max = 9007199254740991; // OK
final minErr = -9007199254740993; // LINT
final maxErr = 9007199254740993; // LINT
final notRounded = 1000000000000000000; // OK
final rounded = 1000000000000000001; // LINT
// value.abs() for this number is negative on the 64-bit integer VM.
// Lucky it is not rounded! (-2^63)
final absNegative = -9223372036854775808; // OK