0.0d == 0.0d + Double.MIN_VALUE returns true
From: Murat Tasan (tasan_at_eecs.cwru.edu)
Date: 04/27/04
- Next message: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Previous message: Cindy Lee: "Struts radio initial values"
- Next in thread: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Reply: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 27 Apr 2004 16:44:21 -0400
so i'm having a slight problem, and i've already looked at the java
language spec which forwarded me to the ieee floating point computation
spec that java uses, but none of those sources really offers me a decent
solution.
the problem is summarized in the subject line:
if you add Double.MIN_VALUE to a double, they are still considered equal
in a comparison.
given a double, i need to find the next smallest double that will result
in a value that is considered distinct to the == operator (and thus also
the <=, <, >, >= operators).
i can just sit and do binary additions to the value and compare each time,
but this will grind my application to a halt.
has anyone else ever had a problem with this and found a nice solution
around it?
thanks,
murat
-- Murat Tasan mxt6@po.cwru.edu tasan@eecs.cwru.edu murat.tasan@cwru.edu http://genomics.cwru.edu
- Next message: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Previous message: Cindy Lee: "Struts radio initial values"
- Next in thread: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Reply: Murat Tasan: "Re: 0.0d == 0.0d + Double.MIN_VALUE returns true"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|