BigInteger

opaque type BigInteger

Big Integer

BigInteger is an opaque value holding java.math.BigInteger

BigInteger is used for really large integer calculations

val max: BigInteger = Stream(58).repeat(35).foldAs(1.Big)(_ * _)

"Largest Bitcoin address= " + max + ", digits=" + max.toString.length tp()

val TenB = 10.Big * 1000 * 1000 * 1000
val YearSecs = 60.Big * 60 * 24 * 365

"Suppose, there is 10 billion computers in the world capable counting 10 billion numbers per second each" tp()
"  Together they will count " + (TenB * TenB) + " in a second" tp()
"  Together they will count " + (TenB * TenB * YearSecs) + " in a year" tp()
"  Together they will count " + (TenB * TenB * YearSecs * TenB) + " in 10 billions years - the 'Age of Universe'" tp()
"It is required "   +   (max / ((TenB * TenB * YearSecs * TenB))) + " 'Ages of Universe'" tp()
"for all todays computers together to just simply count all Bitcoin adresses" tp()

// Output ****************************************************************************************************************
Suppose, there is 10 billion computers in the world capable counting 10 billion numbers per second each
Together they will count 100000000000000000000 in a second
Together they will count 3153600000000000000000000000 in a year
Together they will count 31536000000000000000000000000000000000 in 10 billions years - the 'Age of Universe'
It is required 1664076041000527808478341 'Ages of Universe'
for all todays computers together to just simply count all Bitcoin adresses
Source
BigInteger.scala

Def

@targetName("remainder")
inline def %(v: Long | BigInteger): BigInteger
@targetName("multiply")
inline def *(v: Long | BigInteger): BigInteger
@targetName("plus")
inline def +(v: Long | BigInteger): BigInteger
@targetName("minus")
inline def -(v: Long | BigInteger): BigInteger
@targetName("divide")
inline def /(v: Long | BigInteger): BigInteger
@targetName("less")
inline def <(v: Long | BigInteger): Boolean
@targetName("lessOrEqual")
inline def <=(v: Long | BigInteger): Boolean
@targetName("greater")
inline def >(v: Long | BigInteger): Boolean
@targetName("greaterOrEqual")
inline def >=(v: Long | BigInteger): Boolean
inline def abs
inline def real: java.math.BigInteger

Real value

Real value

Returns real value standing behind the opaque type.

This is a zero cost call.

Inherited from
_methods
Source
Base.scala
inline def sign: Int
inline def toLong: Long
inline def toNumber: java.math.BigInteger
inline def unary_-