Natural logarithm method not recognised  
Author Message
Octavio





PostPosted: 2008-6-7 1:46:00 Top

java-programmer, Natural logarithm method not recognised Good day dear members of the comp.lang.java.programmer newsgroup.
I've got the following error message while trying to use the "logl()"
method (natural logarithm function) on my NetBeans IDE

symbol : method logl(double)
location: class org.me.mylib.fluidmechanics.DarcyLaw
wfr = 7.08e-3 * ko_dl * depth_dl * (pr_dl - wbp_dl) / (mu_dl *
bo_dl * ((logl(re_dl/rw_dl) - 0.75)));

1 error

Should I import any special mathematic library from NetBeans?

Many thanks.

Octavio
 
Matt Humphrey





PostPosted: 2008-6-7 2:01:00 Top

java-programmer >> Natural logarithm method not recognised
"Octavio" <email***@***.com> wrote in message
news:email***@***.com...
> Good day dear members of the comp.lang.java.programmer newsgroup.
> I've got the following error message while trying to use the "logl()"
> method (natural logarithm function) on my NetBeans IDE
>
> symbol : method logl(double)
> location: class org.me.mylib.fluidmechanics.DarcyLaw
> wfr = 7.08e-3 * ko_dl * depth_dl * (pr_dl - wbp_dl) / (mu_dl *
> bo_dl * ((logl(re_dl/rw_dl) - 0.75)));
>
> 1 error
>
> Should I import any special mathematic library from NetBeans?

Do you mean java.lang.Math.log () ? I've never seen "logl", which looks
like it should be a static method in your own class. No special import is
needed for java.lang.Math, but it has no logl. The math functions are
really static methods--you have to name the class you're using, as in

double t = Math.log (a / b);

Matt Humphrey http://www.iviz.com/


 
Eric Sosman





PostPosted: 2008-6-7 2:05:00 Top

java-programmer >> Natural logarithm method not recognised Octavio wrote:
> Good day dear members of the comp.lang.java.programmer newsgroup.
> I've got the following error message while trying to use the "logl()"
> method (natural logarithm function) on my NetBeans IDE
>
> symbol : method logl(double)
> location: class org.me.mylib.fluidmechanics.DarcyLaw
> wfr = 7.08e-3 * ko_dl * depth_dl * (pr_dl - wbp_dl) / (mu_dl *
> bo_dl * ((logl(re_dl/rw_dl) - 0.75)));
>
> 1 error
>
> Should I import any special mathematic library from NetBeans?

No, but you should stop trying to convert C to Java by mere
transliteration. For starters, C's logl() function takes a
`long double' argument and delivers a `long double' result,
but Java has no `long double' type. (I mention this because
if your algorithm really needs ultra-high floating-point
precision, porting it to Java's medium-high precision may
be far more involved than just translating the source code.)
If you can make do with the ordinary `double' numbers Java
provides, you need the log() method, not logl(). And, by
the way, log() is a static method of the java.lang.Math and
java.lang.StrictMath classes, so you'll need to write Math.log()
or StrictMath.log() in your formulas, or use a "static import:"

import java.lang.Math.log; // or StrictMath
...
double roller = log(...);

--
email***@***.com

 
 
Roedy Green





PostPosted: 2008-6-7 8:50:00 Top

java-programmer >> Natural logarithm method not recognised On Fri, 6 Jun 2008 10:46:04 -0700 (PDT), Octavio
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :

>logl()"

I think you meant Math.log()
--

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
 
Octavio





PostPosted: 2008-6-7 21:36:00 Top

java-programmer >> Natural logarithm method not recognised On 7 juin, 02:50, Roedy Green <email***@***.com>
wrote:
> On Fri, 6 Jun 2008 10:46:04 -0700 (PDT), Octavio
> <email***@***.com> wrote, quoted or indirectly quoted someone who
> said :
>
> >logl()"
>
> I think you meant Math.log()
> --
>
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com

Many thanks to all of you three for your help and answers. Using the
"import java.lang.Math.*;" and Math.log() function there's no more
error message.

Octavio
 
 
Hendrik Maryns





PostPosted: 2008-6-9 18:27:00 Top

java-programmer >> Natural logarithm method not recognised -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Octavio schreef:
| On 7 juin, 02:50, Roedy Green <email***@***.com>
| wrote:
|> On Fri, 6 Jun 2008 10:46:04 -0700 (PDT), Octavio
|> <email***@***.com> wrote, quoted or indirectly quoted someone who
|> said :
|>
|>> logl()"
|> I think you meant Math.log()
|> --
|>
|> Roedy Green Canadian Mind Products
|> The Java Glossaryhttp://mindprod.com
|
| Many thanks to all of you three for your help and answers. Using the
| "import java.lang.Math.*;" and Math.log() function there's no more
| error message.

But the question remains whether your code is correct. Read Eric鈥檚 post
carefully.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD4DBQFITQVhe+7xMGD3itQRAkE5AJ9YhJRbcFsNMyuoMB5gaU0Z1oYmVwCXeH3w
BKyI2bXsuLwaWyam9nnwJw==
=9Aui
-----END PGP SIGNATURE-----