Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Any math experts know what I'm missing here? [Solved]
#5
For Spriggsy:
Code: (Select All)
$Console:Only
Dim As Double d, h, i, j, n, r
n = 10: root = 3
For g = 1 To 5 ' Just do 5 iterations with no decimal point for this demo.
    Print "working number ="; n
    If h = 0 Then
        Print "Initial loop..."
        For h = 1 To 10
            If h ^ root > n Then Exit For
        Next
        h = h - 1
        x = h ^ root ' This is the answer digit for the first iteration.
    Else
        For h = 1 To 10
            j = h * (((root * (i * 10 ^ (root - 2))) * ((i * 10 ^ (root - 2)) + h) + h ^ (root - 1)))
            Print h; i, j; "<>"; n
            If j > n Then Exit For
        Next
        h = h - 1
        d = i * (10 ^ (root - 2))
        Color 2: Print "d ="; d, "h ="; h: Color 7
        x = h * (((root * d) * (d + h) + h ^ (root - 1)))
    End If
    Print "Number to subtract ="; x
    Rem i = i * (10 ^ (root - 2)) + h
    i = Val(LTrim$(Str$(i)) + LTrim$(Str$(h)))
    Color 14: Print " i as digits ="; i: Color 7
    r = (n - x)
    n = r * 10 ^ root
    Print "Remainder ="; r ' This is the remainder.
    Print "n ="; n; " d ="; d; " h ="; h; "remainder ="; r; "Answer ="; i
Next

Don't know why Pete didn't fix it himself, too tired?


Quote:I do not understand your problem. Why about the extensions of the binomial theorem? You can easily calculate the cube root with the now well-known formula. Or am I misunderstanding the question?


I think Pete is looking for a routine to do roots he can translate to string math. I don't get the Binomial Theorem reference either but the code does get the first digits of 10^.3333... and some other like n = 5 or 27 or .027 or 125 (but not 125^3) but no decimal placements.
  724  855  599  923  575  468  400  206  147  564  878  823  652  556 bxor cross forever
Reply


Messages In This Thread
RE: Any math experts know what I missing here? - by bplus - 09-23-2022, 02:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  _putimage (Solved) Pete 0 224 11-16-2025, 06:48 AM
Last Post: Pete
  random maze map. math help pmackay 4 572 08-10-2025, 11:22 AM
Last Post: pmackay
Tongue Ubuntu 18.0.4 C++ Compilation Failed SOLVED (sorta) Shed_Grill 6 885 07-14-2025, 12:32 AM
Last Post: Shed_Grill
  After using the font, the IDE is ripe for reinstallation SOLVED! Petr 8 1,405 12-12-2024, 04:45 PM
Last Post: Petr
  [Solved] How come CLS clears more than the _DEST image here? Dav 2 770 10-07-2024, 12:14 AM
Last Post: Dav

Forum Jump:


Users browsing this thread: 1 Guest(s)