mirror of
https://github.com/lompik/pari.nim
synced 2026-01-02 07:54:40 +00:00
No description
| examples | ||
| .gitignore | ||
| LICENSE | ||
| pari.nim | ||
| pari.nimble | ||
| README.org | ||
Pari/Gp C library wrapper for nim
This is a nim modules with binding to the Pari/Gp library wrapper.
Use
The Pari/Gp - version 2.7.5 - libraries need to be accesssible for dynamic loading.
import pari will import all (or most) C defined functions from Pari/Gp to nim. New type introduced :'GEN'. 'newGEN(1)' to create a new 'GEN' type.
Supported operators includes: '+,-,*,/,^', '$', 'mod', '<,>,==' etc..
Examples:
pari_init(2000000,2000)
var numprime=(newGEN(2)^701+1) / 3
echo numprime
echo "is prime?", isprime(numprime)
Garbage collection needs to be done manually as with the Pari/Gp C code.