ryu_floating_decimal 0.1.0

Fast floating point to floating decimal conversion. See the crate 'ryu' for more details
Documentation
  • Coverage
  • 55.56%
    5 out of 9 items documented2 out of 2 items with examples
  • Size
  • Source code size: 85.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 365.19 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Torrencem/ryu-floating-decimal
    0 0 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Torrencem

Ryu Floating Decimal

This crate directly copies the internals of the ryu rust crate, exposing some useful functions and types for more flexible float printing.

This crate exposes the functions d2d and f2d, which convert from f64 to FloatingDecimal64 and f32 to FloatingDecimal32 respectively. These floating decimals can be converted to strings in a custom way.

See the original crate for benchmarks and other information.

Example

use ryu_floating_decimal::f2d;
let value: f32 = 12.091;
let decimal = f2d(value);
assert_eq!(decimal.mantissa, 12091);
assert_eq!(decimal.exponent, -3);

License

Licensed under Apache License, Version 2.0, copied from the original crate