<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openmano-mpy/tests/float, branch master</title>
<subtitle>MicroPython source and hardware configuration for OpenMano</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/'/>
<entry>
<title>py: Fix handling of NaN in certain pow implementations.</title>
<updated>2020-09-11T00:04:57+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-09-08T13:22:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=2e54d9d146b34d7ad00e4394c9767f4319244cdf'/>
<id>2e54d9d146b34d7ad00e4394c9767f4319244cdf</id>
<content type='text'>
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with
toolchains that don't handle pow-of-NaN correctly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with
toolchains that don't handle pow-of-NaN correctly.
</pre>
</div>
</content>
</entry>
<entry>
<title>py/objfloat: Fix handling of negative float to power of nan.</title>
<updated>2020-09-11T00:03:57+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-09-04T01:04:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=8d5a40c86e384bf3cddb2f687374e0bb1ae6df7d'/>
<id>8d5a40c86e384bf3cddb2f687374e0bb1ae6df7d</id>
<content type='text'>
Prior to this commit, pow(-2, float('nan')) would return (nan+nanj), or
raise an exception on targets that don't support complex numbers.  This is
fixed to return simply nan, as CPython does.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prior to this commit, pow(-2, float('nan')) would return (nan+nanj), or
raise an exception on targets that don't support complex numbers.  This is
fixed to return simply nan, as CPython does.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: Rename "sys" module to "usys".</title>
<updated>2020-09-03T14:10:24+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-06-18T09:19:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=40ad8f1666b265dafc7844d765f45cfae4b6299f'/>
<id>40ad8f1666b265dafc7844d765f45cfae4b6299f</id>
<content type='text'>
This is consistent with the other 'micro' modules and allows implementing
additional features in Python via e.g. micropython-lib's sys.

Note this is a breaking change (not backwards compatible) for ports which
do not enable weak links, as "import sys" must now be replaced with
"import usys".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is consistent with the other 'micro' modules and allows implementing
additional features in Python via e.g. micropython-lib's sys.

Note this is a breaking change (not backwards compatible) for ports which
do not enable weak links, as "import sys" must now be replaced with
"import usys".
</pre>
</div>
</content>
</entry>
<entry>
<title>all: Update Python code to conform to latest black formatting.</title>
<updated>2020-08-29T05:18:01+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-08-29T05:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=06659077a81b85882254cf0953c33b27614e018e'/>
<id>06659077a81b85882254cf0953c33b27614e018e</id>
<content type='text'>
Updating to Black v20.8b1 there are two changes that affect the code in
this repository:

- If there is a trailing comma in a list (eg [], () or function call) then
  that list is now written out with one line per element.  So remove such
  trailing commas where the list should stay on one line.

- Spaces at the start of """ doc strings are removed.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Updating to Black v20.8b1 there are two changes that affect the code in
this repository:

- If there is a trailing comma in a list (eg [], () or function call) then
  that list is now written out with one line per element.  So remove such
  trailing commas where the list should stay on one line.

- Spaces at the start of """ doc strings are removed.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Split out complex reverse-op tests to separate test file.</title>
<updated>2020-08-29T04:12:20+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-08-29T04:04:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=0c7354afaf91da3dac2c5ec471603c9e7acc8eac'/>
<id>0c7354afaf91da3dac2c5ec471603c9e7acc8eac</id>
<content type='text'>
So they can be skipped if __rOP__'s are not supported on the target.  Also
fix the typo in the complex_special_methods.py filename.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
So they can be skipped if __rOP__'s are not supported on the target.  Also
fix the typo in the complex_special_methods.py filename.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>py/objcomplex: Add mp_obj_get_complex_maybe for use in complex bin-op.</title>
<updated>2020-06-26T15:03:10+00:00</updated>
<author>
<name>Damien George</name>
</author>
<published>2020-06-22T00:21:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=9f911d822ee97edaa94873823db5eb10c31f5f77'/>
<id>9f911d822ee97edaa94873823db5eb10c31f5f77</id>
<content type='text'>
This allows complex binary operations to fail gracefully with unsupported
operation rather than raising an exception, so that special methods work
correctly.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows complex binary operations to fail gracefully with unsupported
operation rather than raising an exception, so that special methods work
correctly.

Signed-off-by: Damien George &lt;damien@micropython.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>py/modmath: Work around msvc float bugs in atan2, fmod and modf.</title>
<updated>2020-05-27T23:54:54+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-05-17T10:29:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=81db22f693d06468d45571a29fc0648a8f5664ce'/>
<id>81db22f693d06468d45571a29fc0648a8f5664ce</id>
<content type='text'>
Older implementations deal with infinity/negative zero incorrectly.  This
commit adds generic fixes that can be enabled by any port that needs them,
along with new tests cases.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Older implementations deal with infinity/negative zero incorrectly.  This
commit adds generic fixes that can be enabled by any port that needs them,
along with new tests cases.
</pre>
</div>
</content>
</entry>
<entry>
<title>py/objint: Do not use fpclassify.</title>
<updated>2020-04-18T12:42:24+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-04-06T08:44:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=f31f9a8b70db03cbcbcf39b493f959d0e284962a'/>
<id>f31f9a8b70db03cbcbcf39b493f959d0e284962a</id>
<content type='text'>
For combinations of certain versions of glibc and gcc the definition of
fpclassify always takes float as argument instead of adapting itself to
float/double/long double as required by the C99 standard.  At the time of
writing this happens for instance for glibc 2.27 with gcc 7.5.0 when
compiled with -Os and glibc 3.0.7 with gcc 9.3.0.  When calling fpclassify
with double as argument, as in objint.c, this results in an implicit
narrowing conversion which is not really correct plus results in a warning
when compiled with -Wfloat-conversion.  So fix this by spelling out the
logic manually.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For combinations of certain versions of glibc and gcc the definition of
fpclassify always takes float as argument instead of adapting itself to
float/double/long double as required by the C99 standard.  At the time of
writing this happens for instance for glibc 2.27 with gcc 7.5.0 when
compiled with -Os and glibc 3.0.7 with gcc 9.3.0.  When calling fpclassify
with double as argument, as in objint.c, this results in an implicit
narrowing conversion which is not really correct plus results in a warning
when compiled with -Wfloat-conversion.  So fix this by spelling out the
logic manually.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/float: Fix cmath_fun_special for MICROPY_FLOAT_IMPL_FLOAT.</title>
<updated>2020-04-18T12:36:49+00:00</updated>
<author>
<name>stijn</name>
</author>
<published>2020-04-01T09:02:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=7fb9edf43653d35d389a4604d7402c85540511a2'/>
<id>7fb9edf43653d35d389a4604d7402c85540511a2</id>
<content type='text'>
When the unix and windows ports use MICROPY_FLOAT_IMPL_FLOAT instead of
MICROPY_FLOAT_IMPL_DOUBLE, the test output has for example
complex(-0.15052, 0.34109) instead of the expected
complex(-0.15051, 0.34109).

Use one decimal place less for the output printing to fix this.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the unix and windows ports use MICROPY_FLOAT_IMPL_FLOAT instead of
MICROPY_FLOAT_IMPL_DOUBLE, the test output has for example
complex(-0.15052, 0.34109) instead of the expected
complex(-0.15051, 0.34109).

Use one decimal place less for the output printing to fix this.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/float: Add new lexer test to test parsing of float without prefix.</title>
<updated>2020-03-30T02:23:05+00:00</updated>
<author>
<name>David Lechner</name>
</author>
<published>2020-03-28T18:33:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/openmano-mpy/commit/?id=6110cd30780c1b539bf9a67352962bf026b6a2ce'/>
<id>6110cd30780c1b539bf9a67352962bf026b6a2ce</id>
<content type='text'>
Since automatically formatting tests with black, we have lost one line of
code coverage.  This adds an explicit test to ensure we are testing the
case that is no longer covered implicitly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since automatically formatting tests with black, we have lost one line of
code coverage.  This adds an explicit test to ensure we are testing the
case that is no longer covered implicitly.
</pre>
</div>
</content>
</entry>
</feed>
