https://github.com/engossoftware/scidec
Scientific number parser
https://github.com/engossoftware/scidec
Last synced: 4 months ago
JSON representation
Scientific number parser
- Host: GitHub
- URL: https://github.com/engossoftware/scidec
- Owner: EngosSoftware
- License: apache-2.0
- Created: 2023-10-30T18:01:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T18:05:13.000Z (4 months ago)
- Last Synced: 2025-02-14T18:32:36.404Z (4 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Number converter from scientific notation
[![Crates.io][crates-badge]][crates-url]
[![MIT licensed][mit-badge]][mit-url]
[![Apache 2.0 licensed][apache-badge]][apache-url]
[![Contributor Covenant][coc-badge]][coc-url][crates-badge]: https://img.shields.io/crates/v/scidec.svg
[crates-url]: https://crates.io/crates/scidec
[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg
[mit-url]: LICENSE-MIT
[mit-license-url]: https://github.com/DecisionToolkit/dsntk-rs/blob/main/LICENSE-MIT
[apache-badge]: https://img.shields.io/badge/License-Apache%202.0-blue.svg
[apache-url]: LICENSE
[apache-license-url]: https://github.com/DecisionToolkit/dsntk-rs/blob/main/LICENSE
[apache-notice-url]: https://github.com/DecisionToolkit/dsntk-rs/blob/main/NOTICE
[coc-badge]: https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg
[coc-url]: CODE_OF_CONDUCT.md
[repository-url]: https://github.com/EngosSoftware/scidec## Overview
This library converts the input text containing a number in scientific notation like:
```text
1234.5678e-2
```into a number, represented by the following tuple:
```rust
(sign, mantissa-hi-64-bits, mantissa-lo-64-bits, exponent)
```## Example
```rust
use scidec::{Number, number_from_string};let result = number_from_string("1234.5678e-2");
match result {
Number::Fin(false, 0, 12345678, -6) => {}
_ => panic!()
}
```## License
Licensed under either of
- [MIT license][mit-url] (see [LICENSE-MIT][mit-license-url]) or
- [Apache License, Version 2.0][apache-url] (see [LICENSE][apache-license-url] and [NOTICE][apache-notice-url])at your option.
## Contribution
Any contributions to [**scidec**][repository-url] are greatly appreciated.
All contributions intentionally submitted for inclusion in the work by you,
shall be dual licensed as above, without any additional terms or conditions.