<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/objfloat.c, branch v1.9.3</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.3</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.9.3'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2017-10-04T01:37:50+00:00</updated>
<entry>
<title>all: Remove inclusion of internal py header files.</title>
<updated>2017-10-04T01:37:50+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-10-04T01:37:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a3dc1b1957d2c96d7c60c2c629c95077b03488a1'/>
<id>urn:sha1:a3dc1b1957d2c96d7c60c2c629c95077b03488a1</id>
<content type='text'>
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
</content>
</entry>
<entry>
<title>py/objfloat: Support raising a negative number to a fractional power.</title>
<updated>2017-09-26T02:57:51+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-09-26T02:57:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bdc6e86e079dd8a82e9ead1d4041c2e17c882437'/>
<id>urn:sha1:bdc6e86e079dd8a82e9ead1d4041c2e17c882437</id>
<content type='text'>
This returns a complex number, following CPython behaviour.  For ports that
don't have complex numbers enabled this will raise a ValueError which gives
a fail-safe for scripts that were written assuming complex numbers exist.
</content>
</entry>
<entry>
<title>py/{objfloat,objcomplex}: Optimise MP_UNARY_OP_ABS by reusing variables.</title>
<updated>2017-09-18T04:31:03+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-09-18T04:31:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=fdb2aa81b7c7588d94ec59932781e14759045df0'/>
<id>urn:sha1:fdb2aa81b7c7588d94ec59932781e14759045df0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/modbuiltins: Implement abs() by dispatching to MP_UNARY_OP_ABS.</title>
<updated>2017-09-17T21:06:43+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-17T21:06:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9dce823cfd0a9991350184f08a1373f3887134f4'/>
<id>urn:sha1:9dce823cfd0a9991350184f08a1373f3887134f4</id>
<content type='text'>
This allows user classes to implement __abs__ special method, and saves
code size (104 bytes for x86_64), even though during refactor, an issue
was fixed and few optimizations were made:

* abs() of minimum (negative) small int value is calculated properly.
* objint_longlong and objint_mpz avoid allocating new object is the
  argument is already non-negative.
</content>
</entry>
<entry>
<title>py/objfloat: Fix binary ops with incompatible objects.</title>
<updated>2017-09-02T20:05:24+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2017-09-02T18:19:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=9950865c39044e9fef295d0676af7c5fd55289ea'/>
<id>urn:sha1:9950865c39044e9fef295d0676af7c5fd55289ea</id>
<content type='text'>
These are now returned as "operation not supported" instead of raising
TypeError. In particular, this fixes equality for float vs incompatible
types, which now properly results in False instead of exception. This
also paves the road to support reverse operation (e.g. __radd__) with
float objects.

This is achieved by introducing mp_obj_get_float_maybe(), similar to
existing mp_obj_get_int_maybe().
</content>
</entry>
<entry>
<title>all: Convert mp_uint_t to mp_unary_op_t/mp_binary_op_t where appropriate</title>
<updated>2017-08-29T03:16:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-08-29T03:04:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=58321dd9854d71a96e5db2d361e0efc05d9de8cf'/>
<id>urn:sha1:58321dd9854d71a96e5db2d361e0efc05d9de8cf</id>
<content type='text'>
The unary-op/binary-op enums are already defined, and there are no
arithmetic tricks used with these types, so it makes sense to use the
correct enum type for arguments that take these values.  It also reduces
code size quite a bit for nan-boxing builds.
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
<entry>
<title>py: Reduce str/repr precision of float numbers when floats are 30-bit.</title>
<updated>2017-04-21T06:21:56+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-19T08:46:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7a72c0db5a6c2b1f0978516134a95bb6867706ef'/>
<id>urn:sha1:7a72c0db5a6c2b1f0978516134a95bb6867706ef</id>
<content type='text'>
With 30-bit floats there aren't enough bits to faithfully print 7 decimal
digits, so reduce the precision to 6 digits.
</content>
</entry>
<entry>
<title>py/objfloat: Add implementation of high-quality float hashing.</title>
<updated>2017-04-12T03:38:17+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-06T07:27:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a73501b1d63e5240cbced95b884383b79f5d6efd'/>
<id>urn:sha1:a73501b1d63e5240cbced95b884383b79f5d6efd</id>
<content type='text'>
Disabled by default.
</content>
</entry>
<entry>
<title>py: Add very simple but correct hashing for float and complex numbers.</title>
<updated>2017-04-04T01:57:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2017-04-04T01:57:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=19f2e47d59b539f94a49137c379c88f0aed53cf1'/>
<id>urn:sha1:19f2e47d59b539f94a49137c379c88f0aed53cf1</id>
<content type='text'>
Hashing of float and complex numbers that are exact (real) integers should
return the same integer hash value as hashing the corresponding integer
value.  Eg hash(1), hash(1.0) and hash(1+0j) should all be the same (this
is how Python is specified: if x==y then hash(x)==hash(y)).

This patch implements the simplest way of doing float/complex hashing by
just converting the value to int and returning that value.
</content>
</entry>
</feed>
