break-infinity.rs

A port of Patashu's break_infinity.js to Rust. It has the Decimal struct which is able to reach a maximum value of 1e1.79e308 instead of f64's maximum of 1.79e308.

Installation

You can install this package via Cargo by adding these lines to your Cargo.toml ```toml [dependencies] break_infinity="0.1.0"

...

```

Usage

This library allows simple creation of Decimal's through many different methods. ```rust use break_infinity as bi;

let x = bi::new(123.4567); let y = bi::fromstring("123456.7e-3"); let z = bi::fromdecimal(x); Methods that return a `Decimal` can also be chained rust use break_infinity as bi;

let short = x.dividedby(y).plus(z).times(9).floor(); let long = x.times("1.23456780123456789e+9") .plus(9876.5432321) .dividedby("4444562598.111772") .ceil(); ``` For a complete list of functions and methods, refer to the docs.

Acknowledgements

Patashu and Razenpok for creating the original break_infinity.js that this is based off of.