Latest recipes tagged "ctypes" and "float"http://code.activestate.com/recipes/tags/ctypes+float/new/2012-05-14T16:49:13-07:00ActiveState Code RecipesHow to Mutate a Float (Python)
2012-05-14T16:49:13-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578132-how-to-mutate-a-float/
<p style="color: grey">
Python
recipe 578132
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/ctypes/">ctypes</a>, <a href="/recipes/tags/experiment/">experiment</a>, <a href="/recipes/tags/float/">float</a>, <a href="/recipes/tags/structure/">structure</a>).
</p>
<p>This is just an experiment to test my mental understanding of Python. It should not be used in any code as is violates the design principle that floats are to be immutable. The code also abuses <code>ctypes</code> and an understanding of how <code>floats</code> are currently arranged in memory. <code>set_float</code> is not guaranteed to work properly on any system, and may fail to work in the future if the data's arrangement changes.</p>