<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Pi Pico (RP2040) MicroPython Double Precision</title><link>/products/raspberry-pi/b/blog/posts/pi-pico-rp2040-micropython-double-precision</link><description>Introduction 


 Pre-built Double Precision MicroPython Firmware 


 Setting up the PC to build MicroPython Firmware 


 Building a Release Version of MicroPython with Double Precision 


 Building Latest Snapshot version of MicroPython with Double Precisio</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Pi Pico (RP2040) MicroPython Double Precision</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/pi-pico-rp2040-micropython-double-precision</link><pubDate>Sun, 17 Oct 2021 01:18:54 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:383b3bd1-ab3d-4696-a7bc-7916835a65f9</guid><dc:creator>shabaz</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Another interesting thing I learned this week, is that despite trying to force variables to be integers, some operations will provide a floating point result.&lt;/p&gt;&lt;p&gt;Those need to then be converted to integer if that is important to whatever you&amp;#39;re doing, otherwise one could continue to use the floating-point result of course. Python (not just MicroPython, but normal Python too) implicitly changes to float whenever it feels the need to. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Another interesting thing is that the following is an integer:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=a+%3D+100000000]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;but the following is floating point:&lt;/p&gt;&lt;p&gt;[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:3ef06e6b-9b7d-4651-b12d-db8be7f5e991:type=text&amp;amp;text=b+%3D+100e6]&lt;/p&gt;&lt;div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here&amp;#39;s the output with the double-precision build of MicroPython, but as mentioned, normal Python does the same thing:&lt;/p&gt;&lt;p&gt;&lt;span&gt;[View:/resized-image/__size/620x226/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-383b3bd1-ab3d-4696-a7bc-7916835a65f9/7433.contentimage_5F00_216646.png:620:226]&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=22028&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Pi Pico (RP2040) MicroPython Double Precision</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/pi-pico-rp2040-micropython-double-precision</link><pubDate>Fri, 15 Oct 2021 19:45:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:383b3bd1-ab3d-4696-a7bc-7916835a65f9</guid><dc:creator>robogary</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Impressive.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=22028&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Pi Pico (RP2040) MicroPython Double Precision</title><link>https://community.element14.com/products/raspberry-pi/b/blog/posts/pi-pico-rp2040-micropython-double-precision</link><pubDate>Fri, 15 Oct 2021 18:14:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:383b3bd1-ab3d-4696-a7bc-7916835a65f9</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>2</slash:comments><description>&lt;p&gt;I&amp;#39;ve been following the discussions on the precision (and other limits) of micro- and circuit Python on the community.&lt;/p&gt;&lt;p&gt;Haven&amp;#39;t the providers of these platforms deliberately restricted the functionality?&lt;/p&gt;&lt;p&gt;The Pico is a microcontroller, typically focused on micro-controlling. The Pi, that comes with a full precision Python, is a processor that is usually aimed at more advanced tasks like calculating.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think it&amp;#39;s great that you can build a custom binary that gives the precision you need. &lt;/p&gt;&lt;p&gt;I also think that the designers made a valid call to restrict the functionality by default and free the related resources for user programs.&lt;/p&gt;&lt;p&gt;Fair?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=22028&amp;AppID=86&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>