Posted: 24th May 2003 1:33
there aren't logarythmes in dbp, so I've made a function

first, I have to tell you that there are two restrictions :
- it doesn't work for the number very high
- it doesn't work for the "first numbers" ("nombres premiers" in french => a number that can be divised only by one and itself) higher than the last first number that you have stocked in the array npr()
but theses restrictions aren't importants because you can easily upgrade this snippet

how do you can upgrade this code ? it's easy :
first, you need a calculator that can give the log of a number in base 10 (I use my TI-30X)
then, you go there : http://no-reality.dyn.dhs.org/public/primes/myriade.php3?myriade=0
after that, look in the code the last first number that is in the array npr() (it is 227 in the code that I'll post)
find in the web site the next first number (it is 229)
add it in the array (make it wider in the dim, not (49) but (50) )

and now, you have one more first number => you can have logs of numbers a bit higher

now, the code : click on the button under this message
Posted: 24th May 2003 1:37
I just made this code today. Maybe not so fast, but works ok.

Kevil
Posted: 24th May 2003 1:47
And I've got a plug-in for it...
Posted: 24th May 2003 2:15
hehe, it looks like that my code is useless ^_^
Posted: 24th May 2003 2:29
Well, I didn't want to say it...
Posted: 24th May 2003 2:45
lol, I know
but there are 2 systems better than mine, so mine is useless
I'm happy of it because my system may bug the game if a too high number is used
Posted: 24th May 2003 6:56
there's no E or Y in logarithm...
Posted: 24th May 2003 15:13
in french there is
hey, kevil, I've made this snippet because a friend asked in the gcn forum if there are logs in dbp
and guess which snippet he posted to tell me that my code is useless
Posted: 20th Jul 2003 8:38
Why don't you just use the taylor series to find the natural logarithm of a number and then from there you would be able to find the logarithm of any number to any base without number restrictions
Posted: 20th Jul 2003 18:43
because DBP is that stupid slow for such works that it will take 10mins for a stupid log *ggg*
Posted: 20th Jul 2003 20:56
But the genius thing about the taylor series is that you can still get a good approximation with very little math at all
Posted: 10th Aug 2003 7:44
I was reading about Eulers Gamma constant the other day and I came up with this

+ Code Snippet
  function ln(x#)

`calculate Hn
   Hold#=0
   for n#=1.00 to x#
    Harm#=1.00/n#
    Hold#=Harm#+Hold#
   next n#

`approximate Hn-ln n
 Gamma#=.5772156
 AppError#=1/(2*x#)
 Gamman#=Gamma#+AppError#

`Subtract Hn-gamma
 Lnx#=Hold#-Gamman#

endfunction Lnx#


It should be pretty quick because on my TI-86 it was fairly quick. Also if you want to find the Log A base B then all you have to do is say ln A/ln B. So if you wanted to find the log of 2 base 10 it would look like

ln(2.00)/ln(10.00)

Also not you need to put a number from the real number line into the function for it to work right
Posted: 10th Aug 2003 7:50
Also note that the higher the number is the more accurate the answer is. The function is only accurate to one decimal place for ln 2 but it is accurate to 5 decimal places for ln 100...so it gets more and more accurate fairly quickly