Re: Weirdness: (-0.666667 + 0.333333)
From: Corne' Cornelius (cornec_at_nospam-for-noreason.uy)
Date: 05/06/04
- Next message: Collegue: "Convert Access into C++"
- Previous message: Gert Van den Eynde: "Re: Weirdness: (-0.666667 + 0.333333)"
- In reply to: Gert Van den Eynde: "Re: Weirdness: (-0.666667 + 0.333333)"
- Next in thread: Chris Dams: "Re: Weirdness: (-0.666667 + 0.333333)"
- Reply: Chris Dams: "Re: Weirdness: (-0.666667 + 0.333333)"
- Reply: Karl Heinz Buchegger: "Re: Weirdness: (-0.666667 + 0.333333)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 06 May 2004 09:39:54 +0200
heh, i also thaught of not worrying about it being 1e-16, but then
there's a pixel missing where x is 0.
Looks like i will have to make 2 loops and 1 statement.
for when:
x - epsilon() < 0
x = 0
x + epsilon() > 0
Gert Van den Eynde wrote:
> Corne' Cornelius wrote:
>
>
>>i should've made it more clear what i actually want to do.
>>
>>I'm not really trying to compare 2 double which could be in accurate
>>becuase of rounding errors.
>>
>>I'm writing a program that draws graphs on a cartesian plane, so in
>>order to go on the x-axis from say -2, to +2, in 20 intervals, i need
>>one of these point to be zero or very close to it.
>>
>>how could i make sure i don't get rounding problems ?
>>
>
> You can't. The only thing you can do is to compare your value of x to zero
> (using fcmp) and if it's close enough force it to be zero. Btw, Is the
> difference between 1e-16 and 0.0 so significant that it will show up on a
> graph in the range [-1,1] ?
>
> bye,
> gert
- Next message: Collegue: "Convert Access into C++"
- Previous message: Gert Van den Eynde: "Re: Weirdness: (-0.666667 + 0.333333)"
- In reply to: Gert Van den Eynde: "Re: Weirdness: (-0.666667 + 0.333333)"
- Next in thread: Chris Dams: "Re: Weirdness: (-0.666667 + 0.333333)"
- Reply: Chris Dams: "Re: Weirdness: (-0.666667 + 0.333333)"
- Reply: Karl Heinz Buchegger: "Re: Weirdness: (-0.666667 + 0.333333)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|