| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Copyright 2009 The Go Authors. All rights reserved. | 5 // Copyright 2009 The Go Authors. All rights reserved. |
| 6 // Use of this source code is governed by a BSD-style | 6 // Use of this source code is governed by a BSD-style |
| 7 // license that can be found in the LICENSE file. | 7 // license that can be found in the LICENSE file. |
| 8 | 8 |
| 9 /* | 9 /* |
| 10 * Copyright (c) 2003-2005 Tom Wu | 10 * Copyright (c) 2003-2005 Tom Wu |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Note: Not declared as final in order to satisfy optimizer, which expects | 59 // Note: Not declared as final in order to satisfy optimizer, which expects |
| 60 // constants to be in canonical form (Smi). | 60 // constants to be in canonical form (Smi). |
| 61 static _Bigint ZERO = new _Bigint(); | 61 static _Bigint ZERO = new _Bigint(); |
| 62 static _Bigint ONE = new _Bigint()._setInt(1); | 62 static _Bigint ONE = new _Bigint()._setInt(1); |
| 63 | 63 |
| 64 // Digit conversion table for parsing. | 64 // Digit conversion table for parsing. |
| 65 static final Map<int, int> DIGIT_TABLE = _createDigitTable(); | 65 static final Map<int, int> DIGIT_TABLE = _createDigitTable(); |
| 66 | 66 |
| 67 // Internal data structure. | 67 // Internal data structure. |
| 68 bool get _neg native "Bigint_getNeg"; | 68 bool get _neg native "Bigint_getNeg"; |
| 69 void set _neg(bool neg) native "Bigint_setNeg"; | 69 void set _neg(bool value) native "Bigint_setNeg"; |
| 70 int get _used native "Bigint_getUsed"; | 70 int get _used native "Bigint_getUsed"; |
| 71 void set _used(int used) native "Bigint_setUsed"; | 71 void set _used(int value) native "Bigint_setUsed"; |
| 72 Uint32List get _digits native "Bigint_getDigits"; | 72 Uint32List get _digits native "Bigint_getDigits"; |
| 73 void set _digits(Uint32List digits) { | 73 void set _digits(Uint32List digits) { |
| 74 // The VM expects digits_ to be a Uint32List. | 74 // The VM expects digits_ to be a Uint32List. |
| 75 assert(digits != null); | 75 assert(digits != null); |
| 76 _set_digits(digits); | 76 _set_digits(digits); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void _set_digits(Uint32List digits) native "Bigint_setDigits"; | 79 void _set_digits(Uint32List value) native "Bigint_setDigits"; |
| 80 | 80 |
| 81 // Factory returning an instance initialized to value 0. | 81 // Factory returning an instance initialized to value 0. |
| 82 factory _Bigint() native "Bigint_allocate"; | 82 factory _Bigint() native "Bigint_allocate"; |
| 83 | 83 |
| 84 // Factory returning an instance initialized to an integer value. | 84 // Factory returning an instance initialized to an integer value. |
| 85 factory _Bigint._fromInt(int i) { | 85 factory _Bigint._fromInt(int i) { |
| 86 return new _Bigint()._setInt(i); | 86 return new _Bigint()._setInt(i); |
| 87 } | 87 } |
| 88 | 88 |
| 89 // Factory returning an instance initialized to a hex string. | 89 // Factory returning an instance initialized to a hex string. |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 void _sqrTo(_Bigint x, _Bigint r) { | 1476 void _sqrTo(_Bigint x, _Bigint r) { |
| 1477 x._sqrTo(r); | 1477 x._sqrTo(r); |
| 1478 _reduce(r); | 1478 _reduce(r); |
| 1479 } | 1479 } |
| 1480 | 1480 |
| 1481 void _mulTo(_Bigint x, _Bigint y, _Bigint r) { | 1481 void _mulTo(_Bigint x, _Bigint y, _Bigint r) { |
| 1482 x._mulTo(y, r); | 1482 x._mulTo(y, r); |
| 1483 _reduce(r); | 1483 _reduce(r); |
| 1484 } | 1484 } |
| 1485 } | 1485 } |
| OLD | NEW |