Bug 17249 – Make BigInt data visible (not modifiable!)

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-03-09T23:16:05Z
Last change time
2018-01-25T21:59:57Z
Assigned to
No Owner
Creator
Paul D. Anderson

Comments

Comment #0 by paul.d.anderson — 2017-03-09T23:16:05Z
Determining the number of decimal digits in a BigInt requires examination of the ulong/uint data. It would be useful to have a straightforward method of doing so. I recommend making the std.internal.math.biguintcore functions peekUlong and peekUint visible at the std.bigint level by adding the following functions to std.bigint: ulong ulongDigit(int n) pure nothrow const @safe @nogc { return data.peekUlong(n); } uint uintDigit(int n) pure nothrow const @safe @nogc { return data.peekUint(n); } I've readied a pull request to add these functions to std.bigint
Comment #1 by greeenify — 2017-07-17T11:21:49Z
> I've readied a pull request to add these functions to std.bigint Are you still working on this?
Comment #2 by github-bugzilla — 2018-01-25T21:59:56Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/dae55d039c8392246514caf6ada93cbb82320511 Fix Issue 17249: Added BigInt.getDigit https://github.com/dlang/phobos/commit/adee662094e6d4f2976e60267c1a552ba9331781 Merge pull request #5987 from JackStouffer/issue17249 Fix Issue 17249: Added BigInt.getDigit