Bug in double precision computing?

  • Thread starter Thread starter Daniel Geisenhoff
  • Start date Start date
D

Daniel Geisenhoff

Hi all,

can anyone explain to me why cdbl(2.8+2.16+2.85) does result in
7.81000000005 instead of 7.81 ?

Our configuration:

Win2k Server SP4
PIII-550
Dot Net Framework 1.1
VS 2003

Many thanks in advance.
Daniel.
 
Use the decimal data type. Otherwise you'll get binary rounding, typical
with any real data types. See the Decimal MSDN reference.
Shan
 
Back
Top