File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,10 +67,13 @@ to read data into an existing buffer.
6767Floating Point
6868~~~~~~~~~~~~~~
6969
70- For the most speed critical sections of code it is worth noting that performing
71- any kind of floating point operation involves heap allocation. Where possible use
72- integer operations and restrict the use of floating point to sections of the code
73- where performance is not paramount.
70+ Some MicroPython ports allocate floating point numbers on heap. Some other ports
71+ may lack dedicated floating-point coprocessor, and perform arithmetic operations
72+ on them in "software" at considerably lower speed than on integers. Where
73+ performance is important, use integer operations and restrict the use of floating
74+ point to sections of the code where performance is not paramount. For example,
75+ capture ADC readings as integers values to an array in one quick go, and only then
76+ convert them to floating-point numbers for signal processing.
7477
7578Arrays
7679~~~~~~
You can’t perform that action at this time.
0 commit comments