mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 03:47:13 +00:00
[corelib_2] fix bigint_from_test for web platforms
Change-Id: Ib97814ba6b30822296c24026ddcd09f119508ed7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108422 Reviewed-by: Lasse R.H. Nielsen <lrn@google.com> Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
parent
ad6b1ebbd6
commit
803658a6d8
|
@ -64,6 +64,12 @@ main() {
|
|||
testInt(int n) {
|
||||
var bigint = new BigInt.from(n);
|
||||
Expect.equals(n, bigint.toInt());
|
||||
|
||||
// If the integers are inexact (e.g. > 2^53 when represented by doubles as
|
||||
// when compiled to JavaScript numbers) then the 'toString' might be rounded
|
||||
// to the nearest equivalent 'nicer looking' number.
|
||||
if (n == n + 1 || n == n - 1) return;
|
||||
|
||||
Expect.equals("$n", "$bigint");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue