#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

#6 in #util-lib

46 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

~2.5MB
~54K SLoC