dimforge / alga

Abstract algebra for Rust.
194 stars 39 forks source link

Support #![no_std]. #42

Closed sebcrozet closed 6 years ago

sebcrozet commented 6 years ago

This can be activated by compiling alga with default-features = false. Disabling std will remove the implementation of trigonometric functions, leaving them dependent on extrenal symbols. For example, if the user uses Real::cos(...), an error stating that the alga_cos_f32 or alga_sin_f32 is undefined will be triggered at link-time. To fix this, the user will have to add their own definition of the cos function to their binary:

#[no-mangle]
pub fn alga_cos_f32(x: f32) -> f32 {
    // Platform-specific implementation of f32.
}