2016-08-03 15:01:27 +00:00
|
|
|
# Rink
|
|
|
|
|
|
|
|
A unit conversion tool in Rust. The name is a subset of `frink`,
|
|
|
|
another unit conversion tool, to indicate that this tool implements a
|
|
|
|
subset of frink's features.
|
|
|
|
|
2016-08-07 18:08:26 +00:00
|
|
|
Select features:
|
|
|
|
- High-precision bignum rational arithmetic
|
|
|
|
- Detailed error messages
|
|
|
|
- IRC bot
|
|
|
|
|
2016-08-03 15:01:27 +00:00
|
|
|
## Install
|
|
|
|
|
|
|
|
`cargo install rink`
|
|
|
|
|
|
|
|
## Examples
|
|
|
|
|
|
|
|
```
|
|
|
|
> kWh/year -> W
|
2016-08-07 18:08:26 +00:00
|
|
|
approx. 0.1140795 W (power)
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
> W -> J
|
|
|
|
Conformance error
|
2016-08-22 02:26:04 +00:00
|
|
|
Left side: 1 watt (power)
|
|
|
|
Right side: 1 joule (energy)
|
2016-08-03 15:01:27 +00:00
|
|
|
Suggestion: multiply left side by time
|
|
|
|
multiply right side by frequency
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
2016-08-22 02:26:04 +00:00
|
|
|
> gallon gasoline -> kWh
|
|
|
|
approx. 36.63388 kWh (energy)
|
2016-08-07 18:08:26 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
> googol^100
|
|
|
|
1.0e10000 (dimensionless)
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
2016-08-03 18:27:36 +00:00
|
|
|
## Library Usage
|
2016-08-03 15:01:27 +00:00
|
|
|
|
|
|
|
Add this to your `Cargo.toml`:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[dependencies]
|
2016-08-07 18:08:26 +00:00
|
|
|
rink = "0.2"
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
and this to your crate root:
|
|
|
|
|
|
|
|
```rust
|
2016-08-03 15:04:40 +00:00
|
|
|
extern crate rink;
|
2016-08-03 15:01:27 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2016-08-22 14:46:22 +00:00
|
|
|
Rink source code is licensed under the Mozilla Public License, version
|
|
|
|
2. See [LICENSE-MPL](./LICENSE-MPL) for details.
|
2016-08-03 15:01:27 +00:00
|
|
|
|
2016-08-22 14:46:22 +00:00
|
|
|
The data file `definitions.units` is licensed under the GNU General
|
|
|
|
Public License, version 3. See [LICENSE-GPL](./LICENSE-GPL) for details.
|
2016-08-03 15:01:27 +00:00
|
|
|
|
|
|
|
### Contribution
|
|
|
|
|
|
|
|
Unless you explicitly state otherwise, any contribution intentionally
|
2016-08-22 14:46:22 +00:00
|
|
|
submitted for inclusion in the work will grant the rights lined out in
|
|
|
|
the MPL, including larger works with secondary licenses.
|
2016-08-07 18:08:26 +00:00
|
|
|
|
|
|
|
## Changelog
|
|
|
|
|
|
|
|
### 0.2.0
|
|
|
|
- Errors for division by zero
|
|
|
|
- Better conversion (->) output
|
|
|
|
- Bignum arithmetic
|
|
|
|
- API docs
|
|
|
|
- IRC bot
|
|
|
|
- Addition
|
|
|
|
|
|
|
|
### 0.1.1
|
|
|
|
- Search for units.txt in standard directories
|
|
|
|
- Rustyline
|
|
|
|
|
|
|
|
### 0.1.0
|
|
|
|
- Initial release
|