Changes by Mark Dickinson dicki...@gmail.com:
--
resolution: - wont fix
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
Mark Dickinson dicki...@gmail.com added the comment:
Dropping this due to lack of time; unless anyone else wants to pick it up, it
should probably be closed as won't fix.
--
assignee: mark.dickinson -
priority: normal - low
___
Python tracker
Rick Regan exploringbin...@gmail.com added the comment:
if (!(dig = quorem(b,d))) {
b = multadd(b, 10, 0); /* very unlikely */
dig = quorem(b,d);
}
This code is part of the algorithm for strtod. Here b and d are
Bigints, and b / d is a
Mark Dickinson dicki...@gmail.com added the comment:
Version of the rewrite_strtod patch applied in r83813.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
Mark Dickinson dicki...@gmail.com added the comment:
Second version of the strtod rewrite; has some additional documentation and
comment fixes. No other significant changes from the first version. This is
still a work in progress.
--
Added file:
Mark Dickinson dicki...@gmail.com added the comment:
r82614: add functionality to change FPU rounding mode (via float.__setround__
and float.__getround__ functions), on platforms that support the standard C99
fesetround and fegetround functions:
float.__getround__()
'tonearest'
1e300 *
Mark Dickinson dicki...@gmail.com added the comment:
Another issue to consider, brought to my attention by Rick Regan:
Python's dtoa.c code likely misbehaves (i.e., returns incorrectly rounded
results) if the FPU rounding mode is anything other than the round-half-to-even
default. (This is
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
- ignore the rounding mode completely, always doing round-half-to-even.
+1
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
Eric Smith e...@trueblade.com added the comment:
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
- ignore the rounding mode completely, always doing round-half-to-even.
+1
Agreed. +1
--
___
Python tracker
Stefan Krah stefan-use...@bytereef.org added the comment:
+1, if the FPU mask is always restored (as I understand, this is the case
now).
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
Mark Dickinson dicki...@gmail.com added the comment:
r82080: Whitespace fixes.
r82081: In strtod, simplify the computation of the initial approximation.
r82082: Fix typo introduced in r82025 (I think); this was preventing
a shortcut from being taken.
r82087: Simplify the ratio function.
Mark Dickinson dicki...@gmail.com added the comment:
Patch that does a fairly significant rewrite of strtod; it's still (mostly)
based on Gay's code, but there are some significant changes.
Some background: strtod, after dealing with easy cases, works roughly as
follows:
(1) Using
Mark Dickinson dicki...@gmail.com added the comment:
r82079: Apply a version of the parsing patch to pull the parsing code
out into a separate function.
Alexander, I agree about the names; I'll do a mass renaming later on. I'm
trying not to mix the significant algorithm-changing commits
Eric Smith e...@trueblade.com added the comment:
It would be easier for me to review if you did it in the other order: fix the
variable names first.
Although I'm still pretty busy and won't have much time to review, so my needs
shouldn't be your first priority.
--
New submission from Mark Dickinson dicki...@gmail.com:
I've opened this issue to track efforts to improve the quality of the
Python/dtoa.c file, which provides Python's string-to-float and float-to-string
conversions.
Particular issues in mind (non-exhaustive):
- do a thorough review and
Changes by Alexander Belopolsky belopol...@users.sourceforge.net:
--
nosy: +belopolsky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
___
Mark Dickinson dicki...@gmail.com added the comment:
Created new 'py3k-dtoa' branch for this work in r82024.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
Mark Dickinson dicki...@gmail.com added the comment:
A couple of preparatory commits:
r82025: In _Py_dg_strtod, 'e' now represents the adjusted exponent rather than
the base exponent; that is, the input value is of the form +- m * 10**e with
0.1 = m 1.0. It's easier to produce such an 'e'
Mark Dickinson dicki...@gmail.com added the comment:
And here's a patch to pull out the parsing stage of _Py_dg_strtod into a
separate function.
--
keywords: +patch
Added file: http://bugs.python.org/file17688/dtoa_parsing.patch
___
Python tracker
Mark Dickinson dicki...@gmail.com added the comment:
r82032: Commit some additional tests for test_strtod.py.
test_extra_long_significand will currently fail; with the dtoa_parsing patch,
it passes.
--
___
Python tracker rep...@bugs.python.org
Changes by Mark Dickinson dicki...@gmail.com:
--
stage: - patch review
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9009
___
Eric Smith e...@trueblade.com added the comment:
I realize the ship's already sailed on this issue [1], but isn't it a problem
that editing this code makes it more difficult to apply patches from Gay's
original code? What do we do if Gay releases a new version of his code with bug
fixes?
Mark Dickinson dicki...@gmail.com added the comment:
Gay's changes tend to be very small; any bugfixes he releases can likely be
applied by hand, if they're relevant.
I did originally want to keep close to Gay's code, but frankly I'm not very
happy with the quality of that code; and in
Mark Dickinson dicki...@gmail.com added the comment:
Here's the section of the 'bigcomp' code that I was referring to above:
/* Now b/d = exactly half-way between the two floating-point values */
/* on either side of the input string. Compute first digit of b/d. */
if
Eric Smith e...@trueblade.com added the comment:
Just to be clear: I'm okay with this divergence, as long as we've made it
clear we're explicitly doing so and we've given our reasons. Mark's done
that, and of course he's the expert in the subject.
--
Mark Dickinson dicki...@gmail.com added the comment:
Here's an updated version of the parsing patch, with rewritten comments, but no
significant code changes.
--
Added file: http://bugs.python.org/file17689/dtoa_parsing2.patch
___
Python tracker
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Mark,
It is great to see you doing this. I looked at this code on several occasions
before and each time ran away scared! I sincerely hope I will understand how
it works after your rewrite.
Just a small suggestion at
27 matches
Mail list logo