En Tue, 26 Aug 2008 18:11:30 -0300, fred8865 <[EMAIL PROTECTED]> escribi�:
I understand that due to different arithmetic used in floating points
they are just approximations. Hence, 180/100=1 in my python interpreter.
How can I tackle this problem of inaccurate floating point numbers?
thank you
John Machin wrote:
On Aug 27, 7:11 am, fred8865 <[EMAIL PROTECTED]> wrote:
I understand that due to different arithmetic used in floating points
they are just approximations. Hence, 180/100=1 in my python interpreter.
It's not "hence". What you are seeing is truncating integer division.
H
thanks guys
fred8865 wrote:
> Hi all,
>
> I understand that due to different arithmetic used in floating points
> they are just approximations. Hence, 180/100=1 in my python interpreter.
> How can I tackle this problem of inaccurate floating point numbers?
> thank you
>
> regards
> xtd
--
http
On Aug 27, 7:11 am, fred8865 <[EMAIL PROTECTED]> wrote:
> I understand that due to different arithmetic used in floating points
> they are just approximations. Hence, 180/100=1 in my python interpreter.
It's not "hence". What you are seeing is truncating integer division.
> How can I tackle this
On Aug 26, 4:11 pm, fred8865 <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I understand that due to different arithmetic used in floating points
> they are just approximations. Hence, 180/100=1 in my python interpreter.
> How can I tackle this problem of inaccurate floating point numbers?
Try actually
> I understand that due to different arithmetic used in floating points
> they are just approximations. Hence, 180/100=1 in my python interpreter.
No, that's not the reason you get 1, it's because the current version
of python does integer division by default. Try doing 180.0/100 or
including
fro