|
Home > Archive > FoxPro Help and Support > December 2005 > CEILING COMMAND PROBLEM
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CEILING COMMAND PROBLEM
|
|
|
| HELLO,
CAN ANYONE TELL ME, HOW IS COMMING THIS WRONG VALUE.
WHEN I M CALCULATING THIS FIGURE.
hh=.2800000000000
? HH*100
IT WUD BE 28.0000000000000
AND WHEN USING CEILING FUNCTION
THIS IS GIVING
? CEILING(hh*100)=29
CAN ANY TELL ME WHY IS COMMING THIS.
THANX
| |
| Josh Assing 2005-12-13, 9:24 am |
|
STOP SHOUTING WE CAN READ JUST FINE YOU GET MORE HELP IF YOU TURN OFF YOUR CAPS
LOCK BESIDES IT IS NOT EASY TO READ ALL CAPS
Bill sucks at math in all his apps:
http://support.microsoft.com/defaul...kb;en-us;Q78113
it's even worse:
?.9999999999999999
? 19999999999999999
Bill apparently thinks he should "add" to a # when he can't handle the precision
vs truncating it. 15 digits is all it can handle...
Playing around with the #'s just made me sick... there's a lot of problems.
theres no way to get 19 from 19.999999999999 -- once vfp "has" that # it's 20
I talked with a guy who's in wiht the vfp team - he doesn't see a problem with
it. In fact, he thinks vfp is doing a good job with math (REALLY!) he thinks
that truncating or tossing an error (numeric overflow) is a bad idea.
go to the universalthread's download library, search for math$summary and use
one of those.
On Tue, 13 Dec 2005 16:44:24 +0530, <Capri> wrote:
>HELLO,
>
>CAN ANYONE TELL ME, HOW IS COMMING THIS WRONG VALUE.
>
>WHEN I M CALCULATING THIS FIGURE.
>
>hh=.2800000000000
>
>? HH*100
>
>IT WUD BE 28.0000000000000
>
>AND WHEN USING CEILING FUNCTION
>
>THIS IS GIVING
>
>? CEILING(hh*100)=29
>
>CAN ANY TELL ME WHY IS COMMING THIS.
>
>THANX
>
>
>
>
--- AntiSpam/harvest ---
Remove X's to send email to me.
| |
| Paul Pedersen 2005-12-13, 9:24 am |
| Standard rounding error problem, been around as long as computers.
Round first, then take CEILING().
<Capri> wrote in message news:uKDSFX9$FHA.3140@TK2MSFTNGP14.phx.gbl...
> HELLO,
>
> CAN ANYONE TELL ME, HOW IS COMMING THIS WRONG VALUE.
>
> WHEN I M CALCULATING THIS FIGURE.
>
> hh=.2800000000000
>
> ? HH*100
>
> IT WUD BE 28.0000000000000
>
> AND WHEN USING CEILING FUNCTION
>
> THIS IS GIVING
>
> ? CEILING(hh*100)=29
>
> CAN ANY TELL ME WHY IS COMMING THIS.
>
> THANX
>
>
>
>
>
|
|
|
|
|