I can see that this thread is old, but this information might be useful for someone.
This a Decimal floating point arithmetic for micropython that I developed. It is available on GitHub.
Search found 8 matches
- Mon May 09, 2022 8:45 pm
- Forum: Development of MicroPython
- Topic: Python decimal module for pyboard micro python
- Replies: 6
- Views: 7341
- Thu Nov 04, 2021 6:12 pm
- Forum: Programs, Libraries and Tools
- Topic: Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
- Replies: 6
- Views: 3283
Re: Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
Thanks for the tests. There are quite fast microcontrollers.
I have added to DecimalNumber class the function atan2(), the 2-argument arctangent.
I have added to DecimalNumber class the function atan2(), the 2-argument arctangent.
- Wed Nov 03, 2021 5:19 pm
- Forum: Programs, Libraries and Tools
- Topic: Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
- Replies: 6
- Views: 3283
Re: Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
Thank you both for your testing and comments. When I have time, I will add atan2() . I have no doubt that many developers can implement that function, but I think it is better to include it in the library, in the collection of tests and in the performance test. A library needs to be useful. If you k...
- Tue Nov 02, 2021 7:54 pm
- Forum: Programs, Libraries and Tools
- Topic: Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
- Replies: 6
- Views: 3283
Announcing DecimalNumber: floating point arithmetic with arbitrary precision for micropython
The library defines the class DecimalNumber that contains all the functionality for decimal floating point arithmetic with arbitrary precision. Decimal floating point arithmetic for micropython Github repository: https://github.com/mpy-dev/micropython-decimal-number The README.md file contains a des...
- Thu Aug 05, 2021 1:43 pm
- Forum: Development of MicroPython
- Topic: Support for __rlt__, __rle__, ...
- Replies: 8
- Views: 5760
Re: Support for __rlt__, __rle__, ...
. . . . . MicroPython does not currently implement this behaviour... although it probably should. The other thing we don't do is support the operators returning NotImplemented... which is why in your sample program you get the error about "Exception: 'int' object has no attribute '__lt__'" which co...
- Wed Aug 04, 2021 3:10 pm
- Forum: Development of MicroPython
- Topic: Support for __rlt__, __rle__, ...
- Replies: 8
- Views: 5760
Re: Support for __rlt__, __rle__, ...
That's strange. I am using a Raspberry Pi Pico: huh... maybe could you share your code? Or a simple snippet that shows the problem? After investigating a bit further, I can see that the problem is related to reverse operators, but not as I thought. This is a small bit of code that shows the problem...
- Wed Aug 04, 2021 6:13 am
- Forum: Development of MicroPython
- Topic: Support for __rlt__, __rle__, ...
- Replies: 8
- Views: 5760
Re: Support for __rlt__, __rle__, ...
Does micropython support __rlt__, __rle__, __req__, __rne__, __rgt__ and __rge__? Yes, but only when MICROPY_PY_REVERSE_SPECIAL_METHODS is enabled at compile time. For some reason it isn't enabled on ESP32, but is on STM32 and Pico. That's strange. I am using a Raspberry Pi Pico: Implementation nam...
- Tue Aug 03, 2021 3:12 pm
- Forum: Development of MicroPython
- Topic: Support for __rlt__, __rle__, ...
- Replies: 8
- Views: 5760
Support for __rlt__, __rle__, ...
Does micropython support __rlt__, __rle__, __req__, __rne__, __rgt__ and __rge__? I include them in my class to compare 'int' numbers to class objects but micropython does not seem to call them. An exception of this kind occurs: "TypeError: unsupported types for __lt__" The same code works with Pyth...