On Fri, Feb 13, 2015 at 6:22 PM, Mark Lawrence wrote:
> On 14/02/2015 00:11, Ian Kelly wrote:
>>
>> On Fri, Feb 13, 2015 at 4:05 PM, Mark Lawrence
>> wrote:
>>>
>>> I still think it's a bug as the 'p' being referred to in the OP's
>>> original
>>> message is "The precision is a decimal number ind
Mark Lawrence wrote:
I still think it's a bug as the 'p' being referred to in the OP's
original message is "The precision is a decimal number indicating how
many digits should be displayed after the decimal point for a floating
point value formatted with 'f' and 'F', or before and after the dec
On 14/02/2015 00:11, Ian Kelly wrote:
On Fri, Feb 13, 2015 at 4:05 PM, Mark Lawrence wrote:
I still think it's a bug as the 'p' being referred to in the OP's original
message is "The precision is a decimal number indicating how many digits
should be displayed after the decimal point for a float
On Fri, Feb 13, 2015 at 4:05 PM, Mark Lawrence wrote:
> I still think it's a bug as the 'p' being referred to in the OP's original
> message is "The precision is a decimal number indicating how many digits
> should be displayed after the decimal point for a floating point value
> formatted with 'f
On 12/02/2015 23:46, Ian Kelly wrote:
On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
from decimal import Decimal as D
x = D(1)/D(999)
'{:.15g}'.format(x)
'0.00100100100100100'
[...]
I'd say it's a bug. P is 15, you've got 17 digits after the decimal place
and two of those are insign
On Fri, Feb 13, 2015 at 2:40 PM, Ian Kelly wrote:
> On Fri, Feb 13, 2015 at 2:22 PM, Grant Edwards
> wrote:
>> On 2015-02-13, Dave Angel wrote:
>>> On the other hand, the Decimal package has a way that the programmer
>>> can tell how many digits to use at each stage of the calculation.
>>
>> Th
On Fri, Feb 13, 2015 at 2:22 PM, Grant Edwards wrote:
> On 2015-02-13, Dave Angel wrote:
>> On the other hand, the Decimal package has a way that the programmer
>> can tell how many digits to use at each stage of the calculation.
>
> That's what surpised me. From TFM:
>
> https://docs.python.org
On 2015-02-13, Dave Angel wrote:
> On 02/13/2015 03:33 PM, Grant Edwards wrote:
>> On 2015-02-13, Ian Kelly wrote:
>>
>>> Significant digits are within the precision of the calculation.
>>> Writing 1.230 indicates that the fourth digit is known to be zero.
>>> Writing 1.23 outside a context of ex
On 02/13/2015 03:33 PM, Grant Edwards wrote:
On 2015-02-13, Ian Kelly wrote:
Significant digits are within the precision of the calculation.
Writing 1.230 indicates that the fourth digit is known to be zero.
Writing 1.23 outside a context of exact calculation indicates that the
fourth digit i
On Fri, Feb 13, 2015 at 1:33 PM, Grant Edwards wrote:
> On 2015-02-13, Ian Kelly wrote:
>> On Fri, Feb 13, 2015 at 7:02 AM, Grant Edwards
>> wrote:
>>> On 2015-02-12, Ian Kelly wrote:
On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
> {:.15g} is supposed to give 15 digits o
On 2015-02-13, Ian Kelly wrote:
> On Fri, Feb 13, 2015 at 7:02 AM, Grant Edwards
> wrote:
>> On 2015-02-12, Ian Kelly wrote:
>>> On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
>>>
{:.15g} is supposed to give 15 digits of precision, but with trailing
zeros removed.
>>>
>>> The
On Fri, Feb 13, 2015 at 7:02 AM, Grant Edwards wrote:
> On 2015-02-12, Ian Kelly wrote:
>> On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
>>
>>> {:.15g} is supposed to give 15 digits of precision, but with trailing
>>> zeros removed.
>>
>> The doc says with "insignificant" trailing zeros
On Fri, Feb 13, 2015 at 2:26 AM, Hrvoje Nikšić wrote:
> Ian Kelly writes:
>> When you specify the a precision of 15 in your format string, you're
>> telling it to take the first 15 of those. It doesn't care that the
>> last couple of those are zeros, because as far as it's concerned,
>> those digi
On 2015-02-12, Ian Kelly wrote:
> On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
>
>> {:.15g} is supposed to give 15 digits of precision, but with trailing
>> zeros removed.
>
> The doc says with "insignificant" trailing zeros removed, not all
> trailing zeros.
Can somebody explain the di
Ian Kelly writes:
> When you specify the a precision of 15 in your format string, you're
> telling it to take the first 15 of those. It doesn't care that the
> last couple of those are zeros, because as far as it's concerned,
> those digits are significant.
OK, it's a bit surprising, but also cons
On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić wrote:
>> > from decimal import Decimal as D
>> > x = D(1)/D(999)
>> > '{:.15g}'.format(x)
>> >>
>> >> '0.00100100100100100'
> [...]
>> > I'd say it's a bug. P is 15, you've got 17 digits after the decimal place
>> > and two of those are
> > from decimal import Decimal as D
> > x = D(1)/D(999)
> > '{:.15g}'.format(x)
> >>
> >> '0.00100100100100100'
[...]
> > I'd say it's a bug. P is 15, you've got 17 digits after the decimal place
> > and two of those are insignificant trailing zeros.
>
> Actually it's the float versio
On Wed, Feb 11, 2015 at 3:19 PM, Ian Kelly wrote:
> On Wed, Feb 11, 2015 at 2:48 PM, Mark Lawrence
> wrote:
>> On 11/02/2015 20:02, Hrvoje Nikšić wrote:
>>>
>>> According to the documentation of the "g" floating-point format,
>>> trailing zeros should be stripped from the resulting string:
>>>
>
On Wed, Feb 11, 2015 at 2:48 PM, Mark Lawrence wrote:
> On 11/02/2015 20:02, Hrvoje Nikšić wrote:
>>
>> According to the documentation of the "g" floating-point format,
>> trailing zeros should be stripped from the resulting string:
>>
>> """
>> General format. For a given precision p >= 1, this r
On 11/02/2015 20:02, Hrvoje Nikšić wrote:
According to the documentation of the "g" floating-point format,
trailing zeros should be stripped from the resulting string:
"""
General format. For a given precision p >= 1, this rounds the number
to p significant digits and then formats the result in
According to the documentation of the "g" floating-point format,
trailing zeros should be stripped from the resulting string:
"""
General format. For a given precision p >= 1, this rounds the number
to p significant digits and then formats the result in either
fixed-point format or in scientific n
21 matches
Mail list logo