D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17249 - Make BigInt data visible (not modifiable!)
Summary: Make BigInt data visible (not modifiable!)
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-09 23:16 UTC by Paul D. Anderson
Modified: 2018-01-25 21:59 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Paul D. Anderson 2017-03-09 23:16:05 UTC
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 Seb 2017-07-17 11:21:49 UTC
> I've readied a pull request to add these functions to std.bigint

Are you still working on this?