Re: This calculation is just wrong / computer can't count!
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Thu, 4 Oct 2007 20:10:56 -0700
1. Take computational math 101.
2. Adjust your expectations.
3. If you calculate the "same" number using different sequence of
operations, you'll get different result.
4. There is no exact result with floating point. Live with it.
"GT" <ContactGT_remove_@xxxxxxxxxxx> wrote in message
news:0057ac41$0$11709$c3e8da3@xxxxxxxxxxxxxxxxxxxx
We all know computers are binary machines, not decimal, but why can't the
computer do the same basic maths as a pocket calculator?!? 25/30 is
0.833recurring and it should calculate, store and display as many digits
as can be stored at the desired level of granularity, not randomly invent
an extra digit on the end! I repeat my question:
How do I get the computer to calculate and store the number of digits that
it can handle and no more. I don't care if it calculates 6, 10, 15, 27
digits, but I do *require* a correct result 25/30 is *NOT* 0.83337 or
0.8333337 or 0.833333333333333333337. and 0.8333337 + 1 is *NOT* 1.8333335
!!
If the C++ basic data types can't handle this basic mathematics, then how
can we even trust it to do 1+1 etc.
.
- References:
- This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: AliR \(VC++ MVP\)
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Les
- Re: This calculation is just wrong / computer can't count!
- From: GT
- Re: This calculation is just wrong / computer can't count!
- From: Les
- Re: This calculation is just wrong / computer can't count!
- From: GT
- This calculation is just wrong / computer can't count!
- Prev by Date: Re: This calculation is just wrong / computer can't count!
- Next by Date: Re: Recreate a Window ... how to stop asserts...?
- Previous by thread: Re: This calculation is just wrong / computer can't count!
- Next by thread: Re: This calculation is just wrong / computer can't count!
- Index(es):
Relevant Pages
|