Understanding powers and indices (simply) - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Understanding powers and indices (simply) (/showthread.php?tid=1015) Pages:
1
2
|
Understanding powers and indices (simply) - PhilOfPerth - 10-28-2022 Firstly, I'm not dumb, I'm old and easily confused, so please try to keep any response simple and unencumbered. I understand that 2^2 means 2*2, and 2^3 means 2*2*2. But I just can't get my head around 2^2.5 and similar. It's obviously not 2*2*half of 2, which is 2*2*1. Can someone explain (clearly) what the term means? My calculator tell me it's about 5.6568 but I can't see where this comes from. RE: Understanding powers and indices (simply) - OldMoses - 10-28-2022 Raising a number to the ^ 2.5 is the same as raising a number to the ^5 and then taking the square root of that result. It's just a decimal representation of a rational number 5/2 Code: (Select All) a = 2 ^ 5 I've never done it, but I suppose there are uses. That said, the fractional form is probably better for something like a cube root, which would be # ^ (1/3) which has an endlessly repeating decimal. It's best left to the machine to do it to its best ability rather than type .3333333333...... RE: Understanding powers and indices (simply) - James D Jarvis - 10-28-2022 It's the decimal expression of a fractional exponent. 2^2.5 is 2^(5/2) which = (sqr(2))^5 (oh darn, someone else beat me to the enter key. and did it better too) RE: Understanding powers and indices (simply) - bplus - 10-28-2022 2 ^ 2.5 = sqr(2) ^ 5 that help? Code: (Select All) Print Sqr(2) * Sqr(2) * Sqr(2) * Sqr(2) * Sqr(2) hint 2.5 = 5/2 and 2 ^ .5 = 2 ^ (1/2) = sqr(2) RE: Understanding powers and indices (simply) - PhilOfPerth - 10-29-2022 Ah, yes, thanks to all three of you. There's light at the end of the tunnel. A bit of my school-days math is coming back now, and I think I can go on from here. RE: Understanding powers and indices (simply) - Pete - 10-29-2022 Well late to the party. I had to deal with just this sort of thing using string math on decimal powers and nth roots. It works well in theory with long division methods, but unlike string math regular division, which I made a very fast routine, the may iterations of decimal powers and nth roots with Pascal's Triangle and binomial expansion is a real speed killer. At some point, I need to take a good look at Jack's dec_float routines. He found some rounding method that seems like it might be reliable. Pete RE: Understanding powers and indices (simply) - bplus - 10-29-2022 It's funny the 3 of us had answered all within a minute of each other, none of us knew the other was replying at same time. We use to get an alert when someone has posted when we go to post our reply. RE: Understanding powers and indices (simply) - PhilOfPerth - 10-29-2022 Actually, don't laugh, but I'm trying to re-invent (for my own use only) string math! I've got the easy ones (add, subtract, multiply, still sorting out division), then looked at powers, and came unstuck. I guess I'll get there, given time. It started out when I read the story to my Grandkids about the king who offered a prize for slaying a dragon, and the winner asked for one grain of rice, doubled, for each square on a chess board. I wanted to find how many grains that would really be, but my computer exploded (not literally). RE: Understanding powers and indices (simply) - Pete - 10-29-2022 Funny, everyone at this forum has a degree in String Theory... except Bill! Pete RE: Understanding powers and indices (simply) - bplus - 10-29-2022 Code: (Select All) _Title "Grains of Rice" ' b+ 2022-10-28 |