Subject Re: Problem with int() function
From Larry Winkler <lawinkler48@gmail.com>
Date Fri, 02 Dec 2016 11:22:49 -0500
Newsgroups dbase.getting-started
Attachment(s) Clip1.jpg

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)