#proc-macro #hobby #util-lib #floating-point

macro real-proc

proc macros for floating point constants

3 releases

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

#7 in #util-lib

Download history 1/week @ 2024-02-13 9/week @ 2024-02-20 70/week @ 2024-02-27 5/week @ 2024-03-05

85 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

~2MB
~51K SLoC