Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String math: Whole # powers easy, decimal powers!!!
#1
I was considering adding powers to my growing string math routines, until I thought about how to handle decimal powers.

For instance:

256^2.25

A pseudo algorithm to handle this crap would go something like...

256^2+25/100 ' Make into a fraction.
256^2+1/4 ' Reduce by GCF.
256^9/4 ' Combine whole number as a fraction with the fraction.
(256^1/4)^9 ' Move the largest whole number outside the equation.
(4 root of 256)^9 ' Apply root calculation.
4^9 = 262,144

Anyway, not to bad, until you get into even something not a whole lot more complicated than log2 of 10 or 2^3.3219280948874

So ...

2^3+3219280948874/10000000000000 ' Make into a fraction.
2^3+1609640474437/5000000000000 ' Reduce by GCF.
2^16609640474437/5000000000000 ' Combine whole number as a fraction with the fraction.
(2^1/5000000000000)^16609640474437 ' Move the largest whole number outside the equation.
(5000000000000 root of 2)^16609640474437 ' Apply root calculation.
Well, if you can f'ing figure out what the 5 f'tillion root of 2 is, you can raise that to the power of 16609640474437 and get 10.


I mean to wipe out some digits and approximate, the 5th root of 2 is approx.1.148 and that to the power of 16.7 gets you pretty close to 10, so this should work, but now I'm wondering after doing square roots, how much more involved it would be to calculate general roots?

Pete
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Determining if variable or static string is passed to a Sub dano 9 1,187 06-20-2025, 06:31 PM
Last Post: CookieOscar
  Most efficient way to build a big variable length string? mdijkens 9 1,842 01-17-2025, 11:36 PM
Last Post: ahenry3068
  Math and Physics stuff SMcNeill 1 526 05-28-2024, 06:25 PM
Last Post: Pete
  The IDE Math Evaluator in Tools TerryRitchie 2 766 05-07-2024, 10:24 PM
Last Post: TerryRitchie
  REDIM, TYPE, and STRING Woes TerryRitchie 16 3,103 04-13-2023, 05:17 AM
Last Post: DSMan195276

Forum Jump:


Users browsing this thread: 1 Guest(s)