NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

import java.lang.math

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
maboc



Joined: 31 Dec 2008
Posts: 20
Location: Netherlands

PostPosted: Thu Jul 23, 2009 9:56 am    Post subject: import java.lang.math Reply with quote

Hi all,

I'm fairly new with java development so don't laugh to loud when you read my posts Smile

I'm developing a small java web application in NB (6.5)

Code:

...
...
import java.lang.Math;
...
...


    private double nv_f_verdeling(float x) {
        return (1 / (sigma * sqrt(PI));
    }


My problem is that NB is telling me: sqrt not a known symbol

I was hoping that importing the java.lang.math would resolve the issue, but it didn't.

So you have any ideas?

Probably something very basic.


Best Regards
Martijn
Back to top
maboc



Joined: 31 Dec 2008
Posts: 20
Location: Netherlands

PostPosted: Thu Jul 23, 2009 12:29 pm    Post subject: Reply with quote

Someone mailed me the solution:
don't import java.lang.Math

use Math.sqrt in your code instead.

It works like a charm.

No my followup questions:
Is java.lang imported by default so that I don't have to explicity import it?
Why didn't importing the java.lang.Math work?
Back to top
michael
Posted via mailing list.





PostPosted: Fri Jul 24, 2009 6:30 am    Post subject: import java.lang.math Reply with quote

Yep. Java.lang.* is importer automatically.

Michael

-----Original Message-----
From: maboc [mailto:address-removed]
Sent: Thursday, July 23, 2009 3:29 PM
To: address-removed
Subject: [nbj2ee] import java.lang.math


Someone mailed me the solution:

don't import java.lang.Math



use Math.sqrt in your code instead.



It works like a charm.



No my followup questions:

Is java.lang imported by default so that I don't have to explicity import it?

Why didn't importing the java.lang.Math work?

------------------------
Best Regards,



Martijn
Back to top
maboc



Joined: 31 Dec 2008
Posts: 20
Location: Netherlands

PostPosted: Fri Jul 24, 2009 6:40 am    Post subject: Re: import java.lang.math Reply with quote

michael wrote:
Yep. Java.lang.* is importer automatically.

Michael


Ah.. OK tnx.
(I was allready thinking so Smile)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo