1 unstable release

0.1.1 Jun 23, 2023

#1311 in Math


Used in dynast

GPL-3.0-or-later

6KB
101 lines

math-symbols

Named symbols for use in compute algebra systems. Symbol names are stored centrally such that copies are cheap and need little memory.

Example

use math_symbols::*;

// Define a number of symbols with variable name equal to symbol name
symbols!(x, y, z);
assert_eq!(x.name(), "x");
assert_eq!(y.name(), "y");
assert_eq!(z.name(), "z");

// Symbols are identified by their names
let xx = Symbol::new("x");
assert_eq!(x, xx);

// Symbols are ordered by their creation time
assert!(x < y);

Similar crates

License: GPL-3.0-or-later


lib.rs:

Named symbols for use in compute algebra systems. Symbol names are stored centrally such that copies are cheap and need little memory.

Example

use math_symbols::*;

// Define a number of symbols with variable name equal to symbol name
symbols!(x, y, z);
assert_eq!(x.name(), "x");
assert_eq!(y.name(), "y");
assert_eq!(z.name(), "z");

// Symbols are identified by their names
let xx = Symbol::new("x");
assert_eq!(x, xx);

// Symbols are ordered by their creation time
assert!(x < y);

Similar crates

Dependencies

~1.2–1.9MB
~35K SLoC