AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

NaN in the JVM

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware
View previous topic :: View next topic  
Author Message
Henry
Guest





PostPosted: Thu May 20, 2004 2:13 pm    Post subject: NaN in the JVM Reply with quote



Hi,

I want to know what is the semantic of the value NaN (when using float). Is
this a special value only for errors ? Or can there be cases where NaN is
set by the JVM in valid operations ?

My understanding of NaN is that it is used each time you divide by zero.


Thanks in advance,
Henry
Back to top
Jonas Geiregat
Guest





PostPosted: Tue Jun 15, 2004 1:55 pm    Post subject: Re: NaN in the JVM Reply with quote



Henry wrote:
Quote:
Hi,

I want to know what is the semantic of the value NaN (when using float). Is
this a special value only for errors ? Or can there be cases where NaN is
set by the JVM in valid operations ?

My understanding of NaN is that it is used each time you divide by zero.


Thanks in advance,
Henry

Doesn't NaN stand for Not a Number ?

Back to top
Chris Smith
Guest





PostPosted: Tue Jun 15, 2004 2:07 pm    Post subject: Re: NaN in the JVM Reply with quote



Jonas Geiregat wrote:
Quote:
Doesn't NaN stand for Not a Number ?


Yes, it does.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Back to top
Andrew Thompson
Guest





PostPosted: Tue Jun 15, 2004 2:16 pm    Post subject: Re: NaN in the JVM Reply with quote

On Tue, 15 Jun 2004 15:55:59 +0200, Jonas Geiregat wrote:
Quote:
Henry wrote:
...
My understanding of NaN is that it is used each time you divide by zero.
...
Doesn't NaN stand for Not a Number ?

It does, try this..

System.out.println( Math.sqrt( -1 ) );

Attempts to divide by zero will also
result in a mathematical entity that
is not representable in the normal
numeric range. (..err I forget the
term for such a number)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Back to top
Mark Bottomley
Guest





PostPosted: Wed Jun 16, 2004 12:19 am    Post subject: Re: NaN in the JVM Reply with quote


"Andrew Thompson" <SeeMySites (AT) www (DOT) invalid> wrote

Quote:
On Tue, 15 Jun 2004 15:55:59 +0200, Jonas Geiregat wrote:
Henry wrote:
..
My understanding of NaN is that it is used each time you divide by
zero.
..
Doesn't NaN stand for Not a Number ?

It does, try this..

System.out.println( Math.sqrt( -1 ) );

Attempts to divide by zero will also
result in a mathematical entity that
is not representable in the normal
numeric range. (..err I forget the
term for such a number)

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

One of the best sites for understanding floating point numbers
is http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html
It identifies Quiet and Signalling Nan's. There are also +/- infinities,
+/- zeroes, denormalized floating point numbers and signed underflows.
The links off the page go to on-line hex/float43/float64 conversions.
You can also find many of the rules for Nan's and infinities in the JVM
spec.

Mark...



Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> JVM, native methods and hardware 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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.