https://github.com/sr-lab/roundalize
Rounds and renders huge rational numbers to human-readable decimals.
https://github.com/sr-lab/roundalize
coq rational-numbers rounding truncation
Last synced: about 1 month ago
JSON representation
Rounds and renders huge rational numbers to human-readable decimals.
- Host: GitHub
- URL: https://github.com/sr-lab/roundalize
- Owner: sr-lab
- License: mit
- Created: 2018-01-04T19:55:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-08T13:10:20.000Z (almost 8 years ago)
- Last Synced: 2025-01-11T15:34:17.736Z (over 1 year ago)
- Topics: coq, rational-numbers, rounding, truncation
- Language: C#
- Size: 11.7 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Roundalize
Rounds and renders huge rational numbers to human-readable decimals.
## Overview
Coq will tend to give big rational numbers (Q) as numerator and denominator. These can be hundreds of digits long and aren't suitable for inclusion in papers or for most data analysis. Roundalize will turn those from a file that looks like this:
```
hello:61211:11345
world:33476:47196
```
Which are of the format `label:numerator:denominator` into this:
```
hello=5.3954
world=0.70929
```
This will work for arbitrarily large numbers.
## Usage
To use the utility, specify the input file path and precision (after the decimal point) as an integer. Results will be printed to stanard output, but are easy enough to redirect to a file using `>` as in the example below. If no precision is specified it will default to `6`.
```
Roundalize [precision] > rounded.txt
```
## Acknowledgements
Fabulous public domain [Gist](https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d) with the `BigDecimal` class by [Jan Christoph Bernack](https://github.com/JcBernack).