_Based

it.grypho.scala.leonardo.core._Based
See the_Based companion class
object _Based

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
_Based.type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def balancedDigits(n: Long): String

Balanced-ternary digits, using T for the digit -1.

Balanced-ternary digits, using T for the digit -1.

The digit set is {-1, 0, 1} — the same alphabet the symmetric ternary logic uses, which is why this base belongs in the library rather than being a bare utility.

Attributes

def digitsOf(n: Long, base: Int): String

Unsigned digit string of n in base, with a leading - for a negative value.

Unsigned digit string of n in base, with a leading - for a negative value.

Attributes

def of(value: Double, base: Int, balanced: Boolean = ...): _Value

Builds a based integer, collapsing to a plain _Number when there is nothing to remember.

Builds a based integer, collapsing to a plain _Number when there is nothing to remember.

Base 10, a non-integral value, a non-finite one, or a base outside 2 .. 36 all yield a _Number: only a genuinely based integer becomes a _Based, exactly as _Truth.of collapses the crisp endpoints and _Complex.of collapses a zero imaginary part.

Attributes

def ofExact(n: BigInt, base: Int, balanced: Boolean = ...): _Value

of in the exact tier (F_0323): the integer n written in base, its value exact. Collapses as of does -- base 10, an invalid radix, a magnitude past 2^53 -- to an exact _Rational rather than a _Number, since the caller's tier is exact.

of in the exact tier (F_0323): the integer n written in base, its value exact. Collapses as of does -- base 10, an invalid radix, a magnitude past 2^53 -- to an exact _Rational rather than a _Number, since the caller's tier is exact.

Value parameters

balanced

whether the digits are the balanced set (base 3 only)

base

the radix

n

the integer

Attributes

Returns

the exact based value, or the integer as a _Rational

def parseBalanced(s: String): Option[Long]

Parses a balanced-ternary digit string (T = -1), or None on an invalid digit.

Parses a balanced-ternary digit string (T = -1), or None on an invalid digit.

Attributes

def parseDigits(s: String, base: Int): Option[Long]

Parses a digit string in base, or None on an invalid digit.

Parses a digit string in base, or None on an invalid digit.

Attributes

The exact integer behind an exact based value, else v itself (F_0323): what an operator reads its operands through, so an exact 0b1010 takes the exact arms. An inexact based value, or any other value, passes unchanged.

The exact integer behind an exact based value, else v itself (F_0323): what an operator reads its operands through, so an exact 0b1010 takes the exact arms. An inexact based value, or any other value, passes unchanged.

Value parameters

v

an evaluated operand

Attributes

Returns

v, or its exact integer

Concrete fields

val MaxBase: Int
val MinBase: Int

Radix bounds: 2 is the smallest meaningful base, 36 exhausts 0-9A-Z.

Radix bounds: 2 is the smallest meaningful base, 36 exhausts 0-9A-Z.

Attributes