Subject |
Re: Problem with int() function |
From |
Akshat Kapoor <akshat.kapoor@kapoorsons.in> |
Date |
Thu, 01 Dec 2016 05:30:15 -0500 |
Newsgroups |
dbase.getting-started |
Attachment(s) |
screenshot.jpg |
Attaching another screen shot
?str(459.9995,8,2) will give an output of 460.00
but int(459.9995/5) will give a result of 91
Regards
Akshat
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?
>
>
|
|
|