[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

algoritme til pow(float, float);



Hejsa Sci-Slugger

Til nogle beregninger på en hjemmeside har jeg
brug for at beregne pow(float x, float y), altså
x^y hvor y = 0.8
Det flotteste ville være en algoritme der kunne
beregne for alle y (større end 0), men da
x^0.8 = x / x^(1/5) kan jeg godt nøjes med
en simpel algoritme der kan beregne x^(1/5).
Dette åbner nemlig for flg. muligheder der senere kunne
blive nødvendige.
..
x^0.4 = x / (x^(1/5))^3
x^0.6 = x / (x^(1/5))^2
x^0.8 = x / x^(1/5)
..
Beregningerne foregår i JavaScript og jeg har kun adgang
til gængse regneregler (+-*/). Har prøvet at fremstille
forskellige iterationer men det er ikke lykkedes mig at
ramme "rigtigt", da x kan svinge fra 100 til 100000.
Er der en her på listen der lige kan slynge et eller
andet smart ud ville jeg blive meget glad ;-)

Hilsen
      Mikael

Btw: Sorry, jeg sender fra MS-Hotmail
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at http://profiles.msn.com.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:34 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *