arby  v0.4.2
Arbitrary precision arithmetic in C++, even at compile time
Namespaces | Classes | Functions
com::saxbophone::arby Namespace Reference

Main namespace. More...

Namespaces

 literals
 Various custom user-defined-literals for creating arby objects.
 

Classes

class  Nat
 Arbitrary-precision unsigned integer type. More...
 

Functions

constexpr Nat pow (const Nat &base, const Nat &exponent)
 
constexpr std::pair< Nat, Natilog (const Nat &base, const Nat &x)
 Calculates integer log of x in base More...
 
std::ostream & operator<< (std::ostream &os, const Nat &object)
 

Detailed Description

Main namespace.

Usage:

using namespace com::saxbophone;
Various custom user-defined-literals for creating arby objects.
Definition: Nat.hpp:820

Function Documentation

◆ ilog()

constexpr std::pair< Nat, Nat > ilog ( const Nat base,
const Nat x 
)
constexpr

Calculates integer log of x in base

Returns
pair of \(floor(log_b(x)),\ ceil(log_b(x))\) for the given base \(b\) and \(x\)
Parameters
basebase to use for \(b\)
xvalue to use for \(x\)
Exceptions
std::domain_errorwhen \(b<2\)
std::domain_errorwhen \(x<1\)
Todo:
Work out time-complexity

◆ operator<<()

std::ostream& com::saxbophone::arby::operator<< ( std::ostream &  os,
const Nat object 
)

◆ pow()

constexpr Nat pow ( const Nat base,
const Nat exponent 
)
constexpr
Returns
base raised to the power of exponent
Parameters
base,exponentparameters for the base and exponent
Todo:
Work out time-complexity

Referenced by com::saxbophone::arby::Nat::pow().

Here is the caller graph for this function: