mkrd/Swift-BigInt

Exponentiation and types

bluetooth-mdw opened this issue · 5 comments

Hi

The README contains the following:

// Exponentiation
BInt ** Int       // Retuns BInt to the power of Int

but I get a compilation error of "Cannot convert value of type 'BInt' to expected argument type 'BDouble'" from the following code. Am I doing something wrong or is the documentation or API at fault?

        let TWO : BInt = 2
        let TWO_SIX_THREE : Int = 263
        var TWO_POW_263 : BInt = TWO ** TWO_SIX_THREE

Thanks in anticipation

Martin

What version of Swift are you using?

Hi! I'm using version 5.

mkrd commented

Possibly https://github.com/mkrd/Swift-BigInt/blob/master/Sources/Swift-Big-Number-Core.swift#L842.
The BDouble equivalent is declared as public, while this is not.
It is weird that the problem is not reproducible, but declaring the function as public might solve the issue

Closing as I believe this is resolved