Subject Re: Problem with int() function
From Larry Winkler <lawinkler49@charter.net>
Date Fri, 17 Mar 2017 10:50:04 -0400
Newsgroups dbase.getting-started
Attachment(s) test.prg

OK.  I'm a pain in the butt.  Here is a little test program to prove my point.  If the Integer function was working properly, there would be nothing to print.

I finally had to disable all the code I had checking the user's input because of this problem.  It seems to me that there is a bug in dBase causing the issue.

Thanks for your patience.

Larry Winkler Wrote:

> Akshat Kapoor Wrote:
>
> > Dear Sir,
> > Tried some of the commands ?int(460/5) , ?int(459/5) , ?int(461/5)
> > but all the answers received were on expected lines.
> > Screen shot attached.
> > You may be using x = int(y/5)
> > where y has been assigned value of 460 from some calculations.
> > try displaying the value of y before the int() command.
> > it could be having values like 459.9995
> >
> > This could be the source of error.
> > such errors are very common in excel.
> > Regards
> > Akshat
> >
> > Larry Winkler Wrote:
> >
> > > I was doing a simple input check and came up with an issue:
> > >
> > > ? 460/5  comes up with 92 (correct)
> > > ? int(460/5) comes back with 91 (incorrect).
> > >
> > > Anyone else notice this?
> >
> > Here is a screen print of the error.
> it was 4.60/.05 not 460/5 (sorry)
>
>