Skip to content

Latest commit

 

History

86 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koto-calc

An interactive calculator and REPL built in Rust on top of the Koto language, with an Algebraeon module for exact algebra: N (natural numbers), Z (integers), Q (rationals), Poly (polynomials), Mat (matrices), Quat (Hamilton quaternions), Alg (real algebraic numbers), ComplexAlg (complex algebraic numbers), Perm/Group (group theory), FF (finite fields), CF (continued fractions), and more. The compatibility aliases NN, ZZ, and ZZn remain available during the 0.2 transition, but new code should use N, Z, and Zn.

Installation

cargo build --release
# or to install globally:
cargo install --path .

Quick Start

# Start the REPL
koto_calc

# Run a script
koto_calc examples/fibonacci.koto

# Evaluate an expression directly
koto_calc -e "print (1..10).sum()"

# Run tests embedded in a script
koto_calc -t script.koto

Algebraeon: Exact Algebra

Algebraeon is what turns koto-calc into more than a general-purpose REPL. It provides arbitrary-precision integers and rationals, exact algebraic numbers, polynomials, matrices, finite fields, permutations and groups, quaternions, continued fractions, and more — without hidden floating-point rounding.

from algebraeon import Q, Poly

print Q(1, 3) + Q(1, 6)        # 1/2
print Poly([6, -5, 1]).factor() # [(-2 + x, 1), (-3 + x, 1)]

Explore the Algebraeon exact-algebra toolbox.

Documentation

Full documentation is available at https://eloitor.github.io/koto-calc/.

License

MIT

koto-calc is built on the Koto language (also MIT), with the Algebraeon module providing exact arithmetic.

About

Experimental algebra library for koto based on algebraeon

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages