https://github.com/trcwm/fplib
Arbitrary precision fixed-point library for C++
https://github.com/trcwm/fplib
arbitrary-precision fixed-point library
Last synced: about 1 year ago
JSON representation
Arbitrary precision fixed-point library for C++
- Host: GitHub
- URL: https://github.com/trcwm/fplib
- Owner: trcwm
- Created: 2017-12-14T15:10:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-13T00:00:17.000Z (about 8 years ago)
- Last Synced: 2025-03-27T21:12:03.916Z (over 1 year ago)
- Topics: arbitrary-precision, fixed-point, library
- Language: C++
- Homepage:
- Size: 71.3 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FPLIB
An arbitrary precision fixed-point library for C++
Author: Niels A. Moseley / Moseley Instruments.
License: to be determined
The aim of this library is to provide a signed fixed-point data type for logic simulation and synthesis as well as digital signal processing applications. It is based on 32-bit words and therefore needs a 32-bit platform to run efficiently.
### Example: sqrt(2)
Using the bisection method, this library was used to determine the square-root of two with 2048 bits of precision. The exact value is between
```0x16a09e667f3bcc908b2fb1366ea957d3e3adec17512775099da2f590b0667322a95f90608757145875163fcdfb907b6721ee950bc8738f694f0090e6c7bf44ed1a4405d0e855e3e9ca60b38c0237866f7956379222d108b148c1578e45ef89c678dab5147176fd3b99654c68663e7909bea5e241f06dcb05dd5494113208194950272956db1fa1dfbe9a74059d7927c1884c9b579aa516ca3719e6836df046d8e0209b803fc646a5e6654bd3ef7b43d7fed437c7f9444260fbd40c483ef55038583f97bbd45efb8663107145d5febe765a49e94ec7f597105fbfc2e1fa763ef01f3599c82f2fe500b848cf0bd252ae046bf9f1ef7947d46769af8c14bcc67c7c2 / 2^2048```
and
```0x16a09e667f3bcc908b2fb1366ea957d3e3adec17512775099da2f590b0667322a95f90608757145875163fcdfb907b6721ee950bc8738f694f0090e6c7bf44ed1a4405d0e855e3e9ca60b38c0237866f7956379222d108b148c1578e45ef89c678dab5147176fd3b99654c68663e7909bea5e241f06dcb05dd5494113208194950272956db1fa1dfbe9a74059d7927c1884c9b579aa516ca3719e6836df046d8e0209b803fc646a5e6654bd3ef7b43d7fed437c7f9444260fbd40c483ef55038583f97bbd45efb8663107145d5febe765a49e94ec7f597105fbfc2e1fa763ef01f3599c82f2fe500b848cf0bd252ae046bf9f1ef7947d46769af8c14bcc67c7c4 / 2^2048.```