[Numpy-discussion] problem with float64's str()
Charles R Harris
Thu Apr 10 19:57:26 CDT 2008
On Thu, Apr 10, 2008 at 6:38 PM, Robert Kern <firstname.lastname@example.org> wrote:
> On Thu, Apr 10, 2008 at 7:31 PM, Charles R Harris
> <email@example.com> wrote:
> > > That said, str(float_numpy_scalar) really should have the same rules
> > > as str(some_python_float).
> > For all different precisions?
> No. I should have said str(float64_numpy_scalar). I am content to
> leave the other types alone.
> > And what should the rules be.
> All Python does is use a lower decimal precision for __str__ than
> > I note that
> > numpy doesn't distinguish between repr and str, maybe we could specify
> > different behavior for the two.
> Yes, precisely.
Well, I know where to do that and have a ticket for it. What I would also
like to do is use float.h for setting the repr precision, but I am not sure
I can count on its presence as it only became part of the spec in 1999. Then
again, that's almost ten years ago. Anyway, python on my machine generates
12 significant digits. Is that common to everyone?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion