Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- From: "Paulo" <projectolda@xxxxxxx>
- Date: Fri, 14 Oct 2005 12:21:16 +0100
Hi All,
I came across a strange situation using VB6 with SP6.
The code bellow illustrates the problem.
Debug.Print 0.09 + 1.9 = 1.99 True
Debug.Print 0.09 + 2.9 = 2.99 True
Debug.Print 0.09 + 3.9 = 3.99 False
Debug.Print 0.09 + 4.9 = 4.99 False
Debug.Print 0.09 + 5.9 = 5.99 True
Does anyone know why is this happening and if there is a way to avoid it ?
TIA,
Paulo
.
- Follow-Ups:
- Re: Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- From: Someone
- Re: Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- From: Bob Butler
- Re: Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- Prev by Date: Re: Err Object Anomaly Bug in VB6+SP5 and How to Reproduce
- Next by Date: Re: Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- Previous by thread: c0000005 - Access Violation
- Next by thread: Re: Arithmetic Bug ?: 0.09 + 3.9 different than 3.99
- Index(es):
Relevant Pages
|