<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to patches</title><link href="https://sourceforge.net/p/fixedpoint/patches/" rel="alternate"/><link href="https://sourceforge.net/p/fixedpoint/patches/feed.atom" rel="self"/><id>https://sourceforge.net/p/fixedpoint/patches/</id><updated>2003-07-23T22:00:06Z</updated><subtitle>Recent changes to patches</subtitle><entry><title>Add support for extracting precision from strings</title><link href="https://sourceforge.net/p/fixedpoint/patches/3/" rel="alternate"/><published>2003-07-23T22:00:06Z</published><updated>2003-07-23T22:00:06Z</updated><author><name>Duane Voth</name><uri>https://sourceforge.net/u/duanev/</uri></author><id>https://sourceforge.netf50da377ed6f91280d002933a6f44162b528f326</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Attached is a patch to extract the initial fixed point&lt;br /&gt;
precision from numbers in string form.  Two interesting&lt;br /&gt;
issues arose during this development:&lt;/p&gt;
&lt;p&gt;For fixed point strings extracting precision is&lt;br /&gt;
straight forward, but for strings in scientific&lt;br /&gt;
notation it is a little awkward.  This is because&lt;br /&gt;
precision means something different in these two&lt;br /&gt;
notations.  In scientific notation precision relates to&lt;br /&gt;
the accuracy of the entire number and an error estimate&lt;br /&gt;
is implied by the number of significant digits.  Fixed&lt;br /&gt;
point numbers however are exactly accurate and their&lt;br /&gt;
precision has no bering on their accuracy.  When&lt;br /&gt;
converting from scientific notation to fixed point,&lt;br /&gt;
fixedpoint.py now captures the entire accuracy of a&lt;br /&gt;
number in scientific notation.&lt;/p&gt;
&lt;p&gt;Prior to patch:&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; print FixedPoint(&amp;amp;quot;12.3e4&amp;amp;quot;)&lt;br /&gt;
123000.0&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; print FixedPoint(&amp;amp;quot;12.3456e-4&amp;amp;quot;)&lt;br /&gt;
0.00&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; &lt;/p&gt;
&lt;p&gt;After patch:&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; print FixedPoint(&amp;amp;quot;12.3e4&amp;amp;quot;)&lt;br /&gt;
123000.0&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; print FixedPoint(&amp;amp;quot;12.3456e-4&amp;amp;quot;)&lt;br /&gt;
0.00123456&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt; print FixedPoint(&amp;amp;quot;12.3456e-4&amp;amp;quot;, 2)&lt;br /&gt;
0.00&lt;br /&gt;
&amp;amp;gt;&amp;amp;gt;&amp;amp;gt;&lt;/p&gt;
&lt;p&gt;The second issue concerns backwards compatibility. &lt;br /&gt;
Prior to this patch it was assumed that the default&lt;br /&gt;
behavior of str(FixedPoint(&amp;amp;quot;45.678&amp;amp;quot;)) should be to&lt;br /&gt;
return &amp;amp;quot;45.68&amp;amp;quot;.  This is useful for conversions where&lt;br /&gt;
the system always uses hundredths of some marker value.&lt;br /&gt;
But it is not obvious behavior for any other use (e.g.&lt;br /&gt;
parsing stock market prices or scientific data). Since&lt;br /&gt;
fixedpoint.py has not yet been accepted into the main&lt;br /&gt;
Python body I propose that we deal with this&lt;br /&gt;
compatability problem now.  Uses of fixedpoint.py that&lt;br /&gt;
require a specific fixed point precision need to&lt;br /&gt;
explicitly declare that precision at the point of&lt;br /&gt;
conversion instead of relying on the default value. &lt;br /&gt;
Otherwise we will never be able to change the default&lt;br /&gt;
value.&lt;/p&gt;
&lt;p&gt;This patch is NOT backwards compatible - it changes the&lt;br /&gt;
default behavior for str(FixedPoint(&amp;amp;quot;45.678&amp;amp;quot;)).  I&lt;br /&gt;
leave it up to the collective to decide the &amp;amp;quot;one&lt;br /&gt;
obvious&amp;amp;quot; way for fixedpoint.py to behave and what&lt;br /&gt;
mechanism should be used to change (and disable) the&lt;br /&gt;
default precision *on the fly*.  If you are using&lt;br /&gt;
fixedpoint.py in a project that assumes the old&lt;br /&gt;
behavior and want to upgrade, add &amp;amp;quot;, 2&amp;amp;quot; to each place a&lt;br /&gt;
string is converted to a fixed point number, or make an&lt;br /&gt;
explicit call to x.set_precision(2) for each fixed&lt;br /&gt;
point value that came from a string.&lt;/p&gt;
&lt;p&gt;Duane&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Full python2.1 support</title><link href="https://sourceforge.net/p/fixedpoint/patches/2/" rel="alternate"/><published>2003-07-09T10:23:47Z</published><updated>2003-07-09T10:23:47Z</updated><author><name>Sébastien Bigaret</name><uri>https://sourceforge.net/u/sbigaret/</uri></author><id>https://sourceforge.netd1df718005090589079bc0d78c5af6bded2a22cd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Despite what is said in v0.1.1's README, it does not&lt;br /&gt;
work with python2.1&lt;br /&gt;
(most of the tests fails)&lt;/p&gt;
&lt;p&gt;There are two problems mainly:&lt;/p&gt;
&lt;p&gt;- property() does not exists, so precision=None,&lt;br /&gt;
however this is not the desired behaviour,&lt;/p&gt;
&lt;p&gt;- type(an_instance) returns types.InstanceType and is&lt;br /&gt;
not callable (different from py2.2 new style classes&lt;br /&gt;
whose type in the class itself)&lt;/p&gt;
&lt;p&gt;You'll find here a patch fixing these problems.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;-- Sébastien Bigaret &amp;amp;lt;sbigaret@users.sourceforge.net&amp;amp;gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Doc changes</title><link href="https://sourceforge.net/p/fixedpoint/patches/1/" rel="alternate"/><published>2003-02-15T22:04:16Z</published><updated>2003-02-15T22:04:16Z</updated><author><name>Tim Peters</name><uri>https://sourceforge.net/u/userid-31435/</uri></author><id>https://sourceforge.netc144e03b58eca88cda1492c448ceb90eb4b3a1d5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;This started by repairing the explanation of rounding.&lt;br /&gt;
That turned out to be a small part of it in the end.&lt;br /&gt;
Most of it is simply reflowing paragraphs to squash &lt;br /&gt;
long lines (if this becomes part of the std library docs, &lt;br /&gt;
Fred will be unhappy if any line spills beyond column &lt;br /&gt;
76 or so).&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>