Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Explination of exponentials (a^b) when b is a float

Author
Message
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 23rd Mar 2006 22:50 Edited at: 23rd Mar 2006 22:50
I'm writing an algorithm to work out exponentials in ASM. So far I've managed to get code working for when a and b (a^b) are integers and when a is a float. I don't really know what to do when b is a float. when it's an integer the process is quite simple:

a=a*a ;repeat b-1 times

What do I do when b is a float (i.e. 2.1)?

~Heed my word hobags: Jism~
Saikoro
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: California
Posted: 23rd Mar 2006 23:13
Try rewriting it to use fractional exponents. Say you had 2.3333, you could write that as 7/2, and with the formant m/n, do the nth root of a then to the power of m.

I think this would work, I could be wrong though.

And the meek shall inherit the Earth...
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 24th Mar 2006 06:05 Edited at: 24th Mar 2006 06:06
This problem was posted in my Discreet Math class, why on a calculator if you input 2^1.5 you get an answer but if you input 2^1.6 you get an error. I'm telling you now that you're waisting your time trying to raise a number to a float. If you raise to a multiple of .5 then there's some stupid formula that you can do with pi, otherwise you have to do some batsh*t insane math. It's simply not neccessary for normal calculators.

Perokreco
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Bosnia and Herzegovina
Posted: 24th Mar 2006 10:06
Well, 2.15=2+0.15=2+15/100=215/100= 100th root to the power of 215
Killswitch
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: School damnit!! Let me go!! PLEASE!!!
Posted: 24th Mar 2006 12:41
The nth root/m power method is good - and works - but it's too hard for me to convert into ASM. I guess it'll have to be a limiation .

Thanks for the suggestions!

~Heed my word hobags: Jism~

Login to post a reply

Server time is: 2024-11-16 18:31:32
Your offset time is: 2024-11-16 18:31:32