Page 1 of 1

logarithm problem

Posted: Tue Nov 09, 2010 10:04 pm
by tolkien
Hello.

I´m trying to do a simply program to sum dB.

I have created a function that read two dB and operate with them
The problem is that the LOG give me problems. It always return 1 tu dBtotal.

And the most simple LOG operation ( Log(c, 10) ) give the error "Too many arguments for this function!"
I´m new in Hollywood and the last time I coded something was a lot of years ago!


Hope for a tip!

Thanks!



Function p_Suma(dx1, dx2)

a = (10^(dx1/10))
b = (10^(dx2/10))
c = a + b

dBtotal = Log(c) /* HERE */
NPrint ("La suma es:",dBtotal)
EndFunction

Re: logarithm problem

Posted: Wed Nov 10, 2010 10:44 pm
by airsoftsoftwair
This is a known bug in Hollywood. It will be fixed in the next version :)

Re: logarithm problem

Posted: Wed Nov 10, 2010 11:45 pm
by tolkien
:cry: Hope do you fix soon! I really thought was becoming mad! :)


Thanks!

Re: logarithm problem

Posted: Thu Nov 11, 2010 9:30 am
by jalih
tolkien wrote::cry: Hope do you fix soon! I really thought was becoming mad! :)
Ld() function at least seems to work in Hollywood and writing your own Log10() function based on that is quite easy...

If I recall correctly, a little bit of math gives us: log10(x) = log2(x) / log2(10)

So our function becomes:

Code: Select all

Function p_log10(n)

	Local result = Ld(n)/Ld(10)

	Return(result)

EndFunction

Re: logarithm problem

Posted: Thu Nov 11, 2010 7:16 pm
by tolkien
Hey! Thanks jalih! I´ll try it later. But a fix would be better! ;)

Re: logarithm problem

Posted: Thu Nov 11, 2010 8:18 pm
by tolkien
Siii! Tried and working! Thanks so much!