Crate m

Source
Expand description

A C free / pure Rust mathematical library (“libm”) for no_std code

This is a port of OpenLibm.

§Usage

Currently, this crate only provides a Float extension trait that’s very similar to the one in std but its method are implemented in pure Rust instead of its methods being wrappers over the system libm. For this reason, this trait is usable in C free, no_std environments.

#![no_std]

use m::Float as _0;

fn foo(x: f32) -> f32 {
    x.atan()
}

Mind you that, at the moment, this extension trait only provides a handful of mathematical functions – only the ones that have been ported to Rust.

§Coverage

So far, these functions have been ported to Rust:

  • atan2f
  • atanf
  • fabs
  • fabsf

Traits§

  • Trait that provides mathematical functions for floating point numbers