Hi again,
On 2 January 2012 06:28, Steven D'Aprano wrote:
>> Another answer is to use Decimal class, which CAN represent decimal values
>> exactly.
>
>
> That only applies to decimal values which can be represented using a fixed
> number of decimal places. So 1/5 is fine, and is 0.2 exactly, but
(You accidentally forgot to include the list when you replied. The
easiest way (for most people) to avoid that is to use Reply-all)
On 01/02/2012 01:00 AM, Sarma Tangirala wrote:
On 2 Jan 2012 08:56, "Dave Angel" wrote:
Easiest answer is to use integers. Scale everything up by a factor of
Hi Steven,
On 2 January 2012 06:28, Steven D'Aprano wrote:
> That only applies to decimal values which can be represented using a fixed
> number of decimal places. So 1/5 is fine, and is 0.2 exactly, but 1/3 is
> not, since it would require an infinite number of decimal places.
Just a small nit
Dave Angel wrote:
Easiest answer is to use integers. Scale everything up by a factor of
100, and you won't need floats at all. Just convert when printing (and
even then you may get into trouble).
Another answer is to use Decimal class, which CAN represent decimal
values exactly.
That onl
On Mon, Jan 2, 2012 at 3:48 AM, brian arb wrote:
> Hello,
> Can some please explain this to me?
> My while loop should continue while "owed" is greater than or equal to "d"
>
> first time the function is called
> the loop exits as expected
> False: 0.00 >= 0.01
> the next time it does not
On 01/01/2012 09:48 PM, brian arb wrote:
Hello,
Can some please explain this to me?
My while loop should continue while "owed" is greater than or equal to "d"
first time the function is called
the loop exits as expected
False: 0.00>= 0.01
the next time it does not
False: 0.01>= 0.010
Hello,
Can some please explain this to me?
My while loop should continue while "owed" is greater than or equal to "d"
first time the function is called
the loop exits as expected
False: 0.00 >= 0.01
the next time it does not
False: 0.01 >= 0.01
Below is the snippet of code, and th