#const #constants #floating #hobby #util-lib #floating-point #frac

no-std const-frac

Types for supporting floating point constants

4 releases

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

#214 in No standard library

Download history 9/week @ 2024-02-19 19/week @ 2024-02-26 10/week @ 2024-03-04 8/week @ 2024-03-11 7/week @ 2024-03-18 3/week @ 2024-03-25 77/week @ 2024-04-01

97 downloads per month
Used in 4 crates

MIT/Apache

64KB
2K SLoC

Latest Release pipeline status coverage report

Description

Utilities for calculating floating point constants in const context.

This package is not intended heavy numerical calculation but just evaluating floating point constants in const contest.

Usage

use ::const_frac::Frac;

const RAD2DEG: f64 = Frac::from_ratio(360, 2, 0).mul(Frac::from_exp_pi(-1)).to_f64();

assert_eq!(RAD2DEG * std::f64::consts::PI, 180f64);

Features

This package has the following feature flags. No feature flags are enabled by default.

Project status

This package is in the very early stage.

Dependencies

~0.7–1.4MB
~29K SLoC