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


Groups > comp.lang.c > #21814

Re: Quasi 0

From "BartC" <bc@freeuk.com>
Newsgroups comp.lang.c
Subject Re: Quasi 0
Date 2012-06-04 13:05 +0100
Organization A noiseless patient Spider
Message-ID <jqi8a7$mlg$1@dont-email.me> (permalink)
References <75ac0f7b-5989-46c4-b35e-e3dbdeddf25a@f14g2000yqe.googlegroups.com> <jqi0nm$d33$1@dont-email.me> <02098625-5771-48e0-baf6-20f41066edb8@h10g2000yqn.googlegroups.com> <jqi531$4kj$1@dont-email.me> <2a148e85-d20a-4500-bdbc-2bb9a5a134fe@c19g2000yqk.googlegroups.com>

Show all headers | View raw


"David RF" <davranfor@gmail.com> wrote in message 
news:2a148e85-d20a-4500-bdbc-2bb9a5a134fe@c19g2000yqk.googlegroups.com...
> On 4 jun, 13:10, James Kuyper <jameskuy...@verizon.net> wrote:

> I'm asking for the simplest way to detect round errors due to binary
> representation
> of floating numbers. learn algebra? career? you assume too much

The simplest way is to test whether the absolute difference between two 
numbers, is less than some threshold such as 0.0001.

What the best value of that should be, and whether having a fixed limit at 
all would work, depends on your application.

If you want to test whether two results are equal, allowing for minor 
rounding errors, then that's a little different, especially if possible 
results cover a wide range of magnitudes. Here you really want to ignore the 
last few bits of the floating point representation, but it gets tricky to do 
and you need a bit of background.

-- 
Bartc 

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 02:32 -0700
  Re: Quasi 0 Noob <root@127.0.0.1> - 2012-06-04 11:56 +0200
    Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 03:05 -0700
      Re: Quasi 0 James Kuyper <jameskuyper@verizon.net> - 2012-06-04 07:10 -0400
        Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 04:48 -0700
          Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 04:56 -0700
          Re: Quasi 0 "BartC" <bc@freeuk.com> - 2012-06-04 13:05 +0100
            Re: Quasi 0 Keith Thompson <kst-u@mib.org> - 2012-06-04 14:55 -0700
          Re: Quasi 0 James Kuyper <jameskuyper@verizon.net> - 2012-06-04 08:05 -0400
        Re: Quasi 0 nick_keighley_nospam@hotmail.com - 2012-06-05 03:54 -0700
          Re: Quasi 0 James Kuyper <jameskuyper@verizon.net> - 2012-06-05 08:07 -0400
          Re: Quasi 0 jgk@panix.com (Joe keane) - 2012-06-05 13:32 +0000
  Re: Quasi 0 Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-04 06:51 -0400
    Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 03:56 -0700
      Re: Quasi 0 "BartC" <bc@freeuk.com> - 2012-06-04 12:08 +0100
        Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 04:14 -0700
      Re: Quasi 0 James Dow Allen <jdallen2000@yahoo.com> - 2012-06-04 04:25 -0700
    Re: Quasi 0 "BartC" <bc@freeuk.com> - 2012-06-04 12:53 +0100
  Re: Quasi 0 James Kuyper <jameskuyper@verizon.net> - 2012-06-04 07:55 -0400
    Re: Quasi 0 David RF <davranfor@gmail.com> - 2012-06-04 04:59 -0700

csiph-web