Crates.io | ape-table-trig-macros |
lib.rs | ape-table-trig-macros |
version | 0.2.0 |
source | src |
created_at | 2023-05-09 03:01:13.551644 |
updated_at | 2023-05-09 19:21:12.290038 |
description | proc macros for ape-table-trig |
homepage | |
repository | https://github.com/Gip-Gip/ape-table-trig |
max_upload_size | |
id | 860212 |
size | 3,518 |
Using these functions can significantly improve performance on systems with limited to no naitive floating point support, like the RP2040. Designed to be no_std compatible out of the box.
use ape_table_trig::*;
// Table has an accuracy down to 1πmrad
static TABLE: [f32; 1000] = trig_table_gen_f32!(1000);
fn main() {
let table = TrigTableF32::new(&TABLE);
// Calculate the sine of 1π radians
let sine = table.sin(PI_F32);
}