Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #11180

Re: Rounding values

From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Rounding values
Date 2012-01-10 11:38 -0500
Organization A noiseless patient Spider
Message-ID <jehpib$b7j$1@dont-email.me> (permalink)
References <913cfe41-9fe7-4a3e-8ce3-52d468d92a30@r5g2000yqc.googlegroups.com> <jehd5k$1sd$1@dont-email.me> <j6kog7h5328nbkllj688esg24hqpbvlhoo@4ax.com>

Show all headers | View raw


On 1/10/2012 9:53 AM, Roedy Green wrote:
> On Tue, 10 Jan 2012 08:06:58 -0500, Eric Sosman
> <esosman@ieee-dot-org.invalid>  wrote, quoted or indirectly quoted
> someone who said :
>
>>      I suspect what you're seeing is not caused by BigDecimal itself,
>> but by small approximation errors in the representation of the `double'
>> values.
>
> for elaboration on this point, see
> http://mindprod.com/jgloss/floatingpoint.html

     An elaboration that begins with "My general rule is, if at
all possible, avoid floating point" may not be the best guide to
the subject.  Would you trust dining advice from someone whose
general rule was to avoid food?

	"Novice computer users solve this problem [floating-point
	inaccuracy] by implicitly trusting in the computer as an
	infallible authority; they tend to believe that all the
	digits of a printed answer are significant. Disillusioned
	computer users have just the opposite approach; they are
	constantly afraid that their answers are meaningless."
	-- DEK, TAOCP 4.2.2

Don't be a novice, but don't be so bitterly disillusioned, either.
Learn how the tools behave, and use them accordingly.

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Rounding values refreegrata <refreegrata@yahoo.com> - 2012-01-10 04:43 -0800
  Re: Rounding values Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-10 08:06 -0500
    Re: Rounding values Roedy Green <see_website@mindprod.com.invalid> - 2012-01-10 06:53 -0800
      Re: Rounding values Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-01-10 11:38 -0500
  Re: Rounding values Tom McGlynn <taqmcg@gmail.com> - 2012-01-10 05:17 -0800
    Re: Rounding values refreegrata <refreegrata@yahoo.com> - 2012-01-10 06:09 -0800

csiph-web