10-01-2022, 05:30 PM
BTW here is copy of proof of concept where I tested this method of Power$ calculation with the QB64 _Float Type:
Code: (Select All)
Option _Explicit
Print power##(8, 1 / 1025)
Function power## (x As _Float, exponent As _Float)
Dim step1 As _Float
step1 = exponent * nLn##(x)
power## = eToTheX##(step1)
End Function
Function nLn## (x As _Float)
Dim As _Float term, xbase, coef, sum, newsum
Dim As Long k, count, kPower
sum = 0
term = (x - 1) / (x + 1)
k = 0
xbase = 1
Do
sum = newsum
coef = 2 / (2 * k + 1) ' 2
kPower = 2 * k + 1 ' 1
While count < kPower
xbase = xbase * term
count = count + 1
Wend
newsum = sum + coef * xbase
k = k + 1
Loop Until sum = newsum
nLn## = sum
End Function
Function eToTheX## (x As _Float)
Dim As _Float sum
Dim As Long n, i
sum = 1: n = 50
For i = n - 1 To 1 Step -1
sum = 1 + x * sum / i
Next
eToTheX## = sum
End Function
b = b + ...