# Using Fixed-Point Data in Python

**URL:** <https://discuss.pynq.io/t/using-fixed-point-data-in-python/2453>\
**Category:** Support\
**Created:** [March 22, 2021, 3:36am UTC](https://discuss.pynq.io/t/using-fixed-point-data-in-python/2453 "2021-03-22T03:36:47Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![pynqzen](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/pynqzen/32/97_2.png) [@pynqzen](https://discuss.pynq.io/u/pynqzen)\
**Post date:** [March 25, 2021, 6:21am UTC](https://discuss.pynq.io/t/using-fixed-point-data-in-python/2453/6 "2021-03-25T06:21:36Z")

</div>

You can look at my Fractal github for one way to do it, see juliabrot.py.

I am using 256 bit fixed point. Python does not have 256-bit precision without using additional modules, all of which were broken when I tried and no time to write my own 🙂 The technique I use here can however be applied to any number of bits as along as it is scaled correctly, see \_to\_fixed256() and \_fixed256\_to\_int32\_oct(). This also demonstrates how to pack the large fixed bit numbers into a 32-bit AXI stream. The data type on the HLS code (which is not open-source) used is ap\_fixed\<256,3\>.

> **[GitHub - FredKellerman/pynq-juliabrot](https://github.com/FredKellerman/pynq-juliabrot)**
>
> Contribute to FredKellerman/pynq-juliabrot development by creating an account on GitHub.

Kind regards

---

_[View the full topic](https://discuss.pynq.io/t/using-fixed-point-data-in-python/2453)._
