<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Objects/floatobject.c, branch v2.2a3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/floatobject.c?h=v2.2a3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/floatobject.c?h=v2.2a3'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-09-05T23:49:24Z</updated>
<entry>
<title>Better error msg for 3-arg pow with a float argument.</title>
<updated>2001-09-05T23:49:24Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-05T23:49:24Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=97f4a33e125dc14c72070bbf38f723aaa26b9df7'/>
<id>urn:sha1:97f4a33e125dc14c72070bbf38f723aaa26b9df7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rework the way we try to check for libm overflow, given that C99 no longer</title>
<updated>2001-09-05T22:36:56Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-05T22:36:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=a40c793d06ee2b42a5013015352616b4ca6b288b'/>
<id>urn:sha1:a40c793d06ee2b42a5013015352616b4ca6b288b</id>
<content type='text'>
requires that errno ever get set, and it looks like glibc is already
playing that game.  New rules:

+ Never use HUGE_VAL.  Use the new Py_HUGE_VAL instead.

+ Never believe errno.  If overflow is the only thing you're interested in,
  use the new Py_OVERFLOWED(x) macro.  If you're interested in any libm
  errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts
  to set errno the way C89 said it worked.

Unfortunately, none of these are reliable, but they work on Windows and I
*expect* under glibc too.
</content>
</entry>
<entry>
<title>Make the error msgs in our pow() implementations consistent.</title>
<updated>2001-09-05T06:24:58Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-05T06:24:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4c483c4d8eac8603ff299adbd373e4f14da61ff9'/>
<id>urn:sha1:4c483c4d8eac8603ff299adbd373e4f14da61ff9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Raise OverflowError when appropriate on long-&gt;float conversion.  Most of</title>
<updated>2001-09-04T05:14:19Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-04T05:14:19Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=9fffa3eea3a7e99b0179988e7a016a45bf63ab96'/>
<id>urn:sha1:9fffa3eea3a7e99b0179988e7a016a45bf63ab96</id>
<content type='text'>
the fiddling is simply due to that no caller of PyLong_AsDouble ever
checked for failure (so that's fixing old bugs).  PyLong_AsDouble is much
faster for big inputs now too, but that's more of a happy consequence
than a design goal.
</content>
</entry>
<entry>
<title>PEP 238 documented -Qwarn as warning only for classic int or long</title>
<updated>2001-09-04T03:51:09Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-04T03:51:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2'/>
<id>urn:sha1:1832de4bc07e7ffd5938b41e8d7d8fcf8b5e12e2</id>
<content type='text'>
division, and this makes sense.  Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
</content>
</entry>
<entry>
<title>New restriction on pow(x, y, z):  If z is not None, x and y must be of</title>
<updated>2001-09-03T08:35:41Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-09-03T08:35:41Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=32f453eaa476c78376cd721d29ba8ab726e400bb'/>
<id>urn:sha1:32f453eaa476c78376cd721d29ba8ab726e400bb</id>
<content type='text'>
integer types, and y must be &gt;= 0.  See discussion at
http://sf.net/tracker/index.php?func=detail&amp;aid=457066&amp;group_id=5470&amp;atid=105470
</content>
</entry>
<entry>
<title>Add warning mode for classic division, almost exactly as specified in</title>
<updated>2001-08-31T17:40:15Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-08-31T17:40:15Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=393661d15fa76ec46e9f7b71e97bf2ed38470620'/>
<id>urn:sha1:393661d15fa76ec46e9f7b71e97bf2ed38470620</id>
<content type='text'>
PEP 238.  Changes:

- add a new flag variable Py_DivisionWarningFlag, declared in
  pydebug.h, defined in object.c, set in main.c, and used in
  {int,long,float,complex}object.c.  When this flag is set, the
  classic division operator issues a DeprecationWarning message.

- add a new API PyRun_SimpleStringFlags() to match
  PyRun_SimpleString().  The main() function calls this so that
  commands run with -c can also benefit from -Dnew.

- While I was at it, I changed the usage message in main() somewhat:
  alphabetized the options, split it in *four* parts to fit in under
  512 bytes (not that I still believe this is necessary -- doc strings
  elsewhere are much longer), and perhaps most visibly, don't display
  the full list of options on each command line error.  Instead, the
  full list is only displayed when -h is used, and otherwise a brief
  reminder of -h is displayed.  When -h is used, write to stdout so
  that you can do `python -h | more'.

Notes:

- I don't want to use the -W option to control whether the classic
  division warning is issued or not, because the machinery to decide
  whether to display the warning or not is very expensive (it involves
  calling into the warnings.py module).  You can use -Werror to turn
  the warnings into exceptions though.

- The -Dnew option doesn't select future division for all of the
  program -- only for the __main__ module.  I don't know if I'll ever
  change this -- it would require changes to the .pyc file magic
  number to do it right, and a more global notion of compiler flags.

- You can usefully combine -Dwarn and -Dnew: this gives the __main__
  module new division, and warns about classic division everywhere
  else.
</content>
</entry>
<entry>
<title>Fix typo: double semicolons.</title>
<updated>2001-08-30T03:09:31Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-08-30T03:09:31Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d93dce1699ed40efdd2f69c18861eba2fa8806f3'/>
<id>urn:sha1:d93dce1699ed40efdd2f69c18861eba2fa8806f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make int, long and float subclassable.</title>
<updated>2001-08-29T15:47:46Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-08-29T15:47:46Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=bef1417f9f31fdf0f7b7bdb458c1c1f17c5cfada'/>
<id>urn:sha1:bef1417f9f31fdf0f7b7bdb458c1c1f17c5cfada</id>
<content type='text'>
This uses a slightly wimpy and wasteful approach, but it works. :-)
</content>
</entry>
<entry>
<title>float_pow:  Put *all* of the burden on the libm pow in normal</title>
<updated>2001-08-23T22:31:37Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-08-23T22:31:37Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=96685bfbf0e954febd4f873721d3db5d03cb2d99'/>
<id>urn:sha1:96685bfbf0e954febd4f873721d3db5d03cb2d99</id>
<content type='text'>
cases.
powu:  Deleted.

This started with a nonsensical error msg:

&gt;&gt;&gt; x = -1.
&gt;&gt;&gt; import sys
&gt;&gt;&gt; x**(-sys.maxint-1L)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in ?
ValueError: negative number cannot be raised to a fractional power
&gt;&gt;&gt;

The special-casing in float_pow was simply wrong in this case (there's
not even anything peculiar about these inputs), and I don't see any point
to it in *any* case:  a decent libm pow should have worst-case error under
1 ULP, so in particular should deliver the exact result whenever the exact
result is representable (else its error is at least 1 ULP).  Thus our
special fiddling for integral values "shouldn't" buy anything in accuracy,
and, to the contrary, repeated multiplication is less accurate than a
decent pow when the true result isn't exactly representable.  So just
letting pow() do its job here (we may not be able to trust libm x-platform
in exceptional cases, but these are normal cases).
</content>
</entry>
</feed>
