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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // Digit conversion table for parsing. | 63 // Digit conversion table for parsing. |
64 static final Map<int, int> DIGIT_TABLE = _createDigitTable(); | 64 static final Map<int, int> DIGIT_TABLE = _createDigitTable(); |
65 | 65 |
66 // Internal data structure. | 66 // Internal data structure. |
67 bool get _neg native "Bigint_getNeg"; | 67 bool get _neg native "Bigint_getNeg"; |
68 void set _neg(bool value) native "Bigint_setNeg"; | 68 void set _neg(bool value) native "Bigint_setNeg"; |
69 int get _used native "Bigint_getUsed"; | 69 int get _used native "Bigint_getUsed"; |
70 void set _used(int value) native "Bigint_setUsed"; | 70 void set _used(int value) native "Bigint_setUsed"; |
71 Uint32List get _digits native "Bigint_getDigits"; | 71 Uint32List get _digits native "Bigint_getDigits"; |
72 void set _digits(Uint32List digits) { | 72 void set _digits(Uint32List value) native "Bigint_setDigits"; |
73 // The VM expects digits_ to be a Uint32List. | |
74 assert(digits != null); | |
75 _set_digits(digits); | |
76 } | |
77 | |
78 void _set_digits(Uint32List value) native "Bigint_setDigits"; | |
79 | 73 |
80 // Factory returning an instance initialized to value 0. | 74 // Factory returning an instance initialized to value 0. |
81 factory _Bigint() native "Bigint_allocate"; | 75 factory _Bigint() native "Bigint_allocate"; |
82 | 76 |
83 // Factory returning an instance initialized to an integer value. | 77 // Factory returning an instance initialized to an integer value. |
84 factory _Bigint._fromInt(int i) { | 78 factory _Bigint._fromInt(int i) { |
85 return new _Bigint()._setInt(i); | 79 return new _Bigint()._setInt(i); |
86 } | 80 } |
87 | 81 |
88 // Factory returning an instance initialized to a hex string. | 82 // Factory returning an instance initialized to a hex string. |
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1633 void _sqrTo(_Bigint x, _Bigint r) { | 1627 void _sqrTo(_Bigint x, _Bigint r) { |
1634 x._sqrTo(r); | 1628 x._sqrTo(r); |
1635 _reduce(r); | 1629 _reduce(r); |
1636 } | 1630 } |
1637 | 1631 |
1638 void _mulTo(_Bigint x, _Bigint y, _Bigint r) { | 1632 void _mulTo(_Bigint x, _Bigint y, _Bigint r) { |
1639 x._mulTo(y, r); | 1633 x._mulTo(y, r); |
1640 _reduce(r); | 1634 _reduce(r); |
1641 } | 1635 } |
1642 } | 1636 } |
OLD | NEW |