#util-lib #hobby #proc-macro

macro real-proc

proc macros for floating point constants

3 releases

Uses new Rust 2021

0.0.3 Mar 13, 2022
0.0.2 Mar 2, 2022
0.0.1 Mar 1, 2022

#1155 in Rust patterns

Download history 25/week @ 2022-06-03 4/week @ 2022-06-10 9/week @ 2022-06-17 8/week @ 2022-06-24 8/week @ 2022-07-01 9/week @ 2022-07-08 11/week @ 2022-07-15 15/week @ 2022-07-22 14/week @ 2022-07-29 16/week @ 2022-08-05 11/week @ 2022-08-12 11/week @ 2022-08-19 9/week @ 2022-08-26 16/week @ 2022-09-02 15/week @ 2022-09-09 10/week @ 2022-09-16

53 downloads per month
Used in 2 crates

MIT/Apache

4KB

Latest Release pipeline status coverage report

Description

Proc-macro for generating Frac from a decimal literal in const context.

Usage

use ::real_proc::frac;
use ::const_frac::Frac;

const CONST: Frac = frac!(const_frac, 3.14e-20);

let int = Frac::from_int(314);
let right = int * Frac::from_exp10(-22);

assert_eq!(CONST, right);

Project status

This package is in the very early stage.

Dependencies

~1–1.4MB
~32K SLoC