mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
bc3aa70e20
TEST=ci Change-Id: I99aa9875705823c22b5474bb1d66c7bc1aaac9fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202309 Reviewed-by: Liam Appelbe <liama@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
18 lines
662 B
Dart
18 lines
662 B
Dart
// Copyright (c) 2021, 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.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
main() {
|
|
// x and y have lengths in 32-bit digits that overflow 16 bits.
|
|
var x = new BigInt.from(13) << (65000 * 32);
|
|
var y = new BigInt.from(42) << (65000 * 32);
|
|
print(x.bitLength);
|
|
Expect.equals(x, (x + y) - y);
|
|
Expect.equals(x, -((-x + y) - y));
|
|
Expect.equals(x, (x << 2) >> 2);
|
|
Expect.equals(x, (x >> 3) << 3);
|
|
Expect.equals(0, (x ^ x).toInt());
|
|
Expect.equals(0, (y ^ y).toInt());
|
|
}
|