fractions and floating point
- From: Steffen <s.weinstock@xxxxxx>
- Date: Thu, 14 Jul 2005 11:32:22 +0200
Hi,
is it possible to have two fractions, which (mathematically) have the order a/b < c/d (a,b,c,d integers), but when (correctly) converted into floating point representation just have the opposite order?
The idea is that the two fractions are almost identical and that the error introduced by going to floating point representation is bigger than the exact difference, but different for the two fractions such that it somehow turns them around.
I tried some numbers, but so far it always was ok.
I know that this depends on the way floating points are represented, so the more precise question would be: is there a standard that would ensure that this never happens? Does somebody have a concrete example for a specific platform?
Thanks Steffen
.
- Follow-Ups:
- Re: fractions and floating point
- From: Christian Bau
- Re: fractions and floating point
- From: Lawrence Kirby
- Re: fractions and floating point
- From: websnarf
- Re: fractions and floating point
- From: *** T. Winter
- Re: fractions and floating point
- From: Allan Bruce
- Re: fractions and floating point
- Prev by Date: Re: Assembly language
- Next by Date: Byte Array in C
- Previous by thread: size of multi-dimensional array and qsort
- Next by thread: Re: fractions and floating point
- Index(es):