Skip to content

Incomplete doc on boundary conditions in BigInter.Pow #9900

Open
@brettshearer

Description

@brettshearer

Consider this awesome code:

var g = 0xffffffffffffffff;
var bi = new BigInteger(g);
bi = BigInteger.Pow(bi, Int32.MaxValue);

Consider this awesome exception:

System.OverflowException: 'Arithmetic operation resulted in an overflow.'

Consider this documentation:
https://learn.microsoft.com/en-us/dotnet/api/system.numerics.biginteger.pow?view=net-8.0

Specifically this incomplete part:

Exceptions
ArgumentOutOfRangeException
exponent is negative.

Is this a central location describing exceptions that may be thrown across all of BigInteger, or should all methods be documented separately?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.NumericsuntriagedNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions