D daniedb Active Member Licensed User Longtime User Sep 12, 2015 #1 Hi Guys How wil this javascript be converted to B4A I've tried the Logarithm keyword but still receive error Code: Copy var totdb = 10 * (Math.log((Math.pow(alpha,2) - Math.pow(rho,2)) / (alpha * (1 - Math.pow(rho,2)))) / Math.LN10); I've tried this... Code: Copy dim var as Float ' all variables alpha, rho, as floats var = 10 * Logarithm((Power(alpha,2) - (Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10) Any help appreciated
Hi Guys How wil this javascript be converted to B4A I've tried the Logarithm keyword but still receive error Code: Copy var totdb = 10 * (Math.log((Math.pow(alpha,2) - Math.pow(rho,2)) / (alpha * (1 - Math.pow(rho,2)))) / Math.LN10); I've tried this... Code: Copy dim var as Float ' all variables alpha, rho, as floats var = 10 * Logarithm((Power(alpha,2) - (Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10) Any help appreciated
DonManfred Expert Licensed User Longtime User Sep 12, 2015 #2 i´m not sure but the () seems wrong... maybe Code: Copy var = 10 * (Logarithm((Power(alpha,2) - Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10) Upvote 0
i´m not sure but the () seems wrong... maybe Code: Copy var = 10 * (Logarithm((Power(alpha,2) - Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10)
D daniedb Active Member Licensed User Longtime User Sep 12, 2015 #3 DonManfred said: i´m not sure but the () seems wrong... maybe Code: Copy var = 10 * (Logarithm((Power(alpha,2) - Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10) Click to expand... Tried that Error return is Error description: Input string was not in a correct format. Thanks Upvote 0
DonManfred said: i´m not sure but the () seems wrong... maybe Code: Copy var = 10 * (Logarithm((Power(alpha,2) - Power(rho,2)) / (alpha * (1 - Power(rho,2))) / ^10) Click to expand... Tried that Error return is Error description: Input string was not in a correct format. Thanks
R Roycefer Well-Known Member Licensed User Longtime User Sep 12, 2015 #4 Code: Copy ^10 doesn't mean anything in B4X. And even if it did, it wouldn't be equivalent to JavaScript's Math.LN10. Furthermore, B4X's Logarithm() function requires two arguments: the number and the base. Try this: Code: Copy Dim totdb as Double = 10*( Logarithm( (Power(alpha,2)-Power(rho,2))/(alpha*(1-Power(rho,2))), cE)/Logarithm(10, cE) ) Upvote 0
Code: Copy ^10 doesn't mean anything in B4X. And even if it did, it wouldn't be equivalent to JavaScript's Math.LN10. Furthermore, B4X's Logarithm() function requires two arguments: the number and the base. Try this: Code: Copy Dim totdb as Double = 10*( Logarithm( (Power(alpha,2)-Power(rho,2))/(alpha*(1-Power(rho,2))), cE)/Logarithm(10, cE) )
D daniedb Active Member Licensed User Longtime User Sep 12, 2015 #5 Roycefer said: Code: Copy ^10 doesn't mean anything in B4X. And even if it did, it wouldn't be equivalent to JavaScript's Math.LN10. Furthermore, B4X's Logarithm() function requires two arguments: the number and the base. Try this: Code: Copy Dim totdb as Double = 10*( Logarithm( (Power(alpha,2)-Power(rho,2))/(alpha*(1-Power(rho,2))), cE)/Logarithm(10, cE) ) Click to expand... Thanks, that did the job Cheers Danie Upvote 0
Roycefer said: Code: Copy ^10 doesn't mean anything in B4X. And even if it did, it wouldn't be equivalent to JavaScript's Math.LN10. Furthermore, B4X's Logarithm() function requires two arguments: the number and the base. Try this: Code: Copy Dim totdb as Double = 10*( Logarithm( (Power(alpha,2)-Power(rho,2))/(alpha*(1-Power(rho,2))), cE)/Logarithm(10, cE) ) Click to expand... Thanks, that did the job Cheers Danie