[5420] in java-interest
Re: Numbers
daemon@ATHENA.MIT.EDU (Jill Shermer)
Thu Feb 8 12:18:24 1996
Date: Thu, 8 Feb 1996 08:04:58 -0800
From: jshermer@BASISinc.com (Jill Shermer)
To: jmarin@mars.superlink.net, jose@ns2.fax.com
Cc: java-interest@java.sun.com
> From jmarin@mars.superlink.net Wed Feb 7 20:29 PST 1996
> Date: Wed, 07 Feb 1996 23:25:56 -0500
> From: Jeff Marin <jmarin@mars.superlink.net>
> Organization: @Work Technologies
> MIME-Version: 1.0
> To: Jill Shermer <jshermer@BASISinc.com>
> Subject: Re: Numbers
>
> > 2. How do you avoid loss of precision with doubles?
> >
> > For example, if a = 300000.33,
> > b = 2,
> > c = a*b,
> >
> > how do you make sure c = 600000.66, not 600001?
> > Is this avoidable?
>
> Jill,
> Is b a double here? If not then c=a*((double)b) will be needed, assuming
> c is a double.
>
It doesn't make a difference if I declare a, b, and c to be doubles,
and make b = 2.00.
-Jill
> ************************************************************************Jeff Marin jmarin@superlink.com
> @Work Technologies http://www.worktechs.com
> < "To err is human, to not learn JAVA mentally healthy but unavoidable!"
> >
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com