Skip to content

Instantly share code, notes, and snippets.

@itfanr
itfanr / ginsh.md
Created August 17, 2020 06:17 — forked from lopesivan/ginsh.md
ginsh is an interactive frontend for the GiNaC symbolic computation framework. It is intended as a tool for testing and experimenting with GiNaC’s features, not as a replacement for traditional interactive computer algebra systems. Although it can do many things these traditional systems can do, ginsh provides no programming constructs like loop…

After invoking ginsh one can test and experiment with GiNaC's features much like in other Computer Algebra Systems except that it does not provide programming constructs like loops or conditionals. For a concise description of the ginsh syntax we refer to its accompanied man page. Suffice to say that assignments and comparisons in ginsh are written as they are in C, i.e. = assigns and == compares.

It can manipulate arbitrary precision integers in a very fast way. Rational numbers are automatically converted to fractions of coprime integers:

> x=3^150;
369988485035126972924700782451696644186473100389722973815184405301748249
> y=3^149;
123329495011708990974900260817232214728824366796574324605061468433916083
> x/y;
@itfanr
itfanr / ginsh.md
Created August 17, 2020 06:17 — forked from lopesivan/ginsh.md
ginsh is an interactive frontend for the GiNaC symbolic computation framework. It is intended as a tool for testing and experimenting with GiNaC’s features, not as a replacement for traditional interactive computer algebra systems. Although it can do many things these traditional systems can do, ginsh provides no programming constructs like loop…

After invoking ginsh one can test and experiment with GiNaC's features much like in other Computer Algebra Systems except that it does not provide programming constructs like loops or conditionals. For a concise description of the ginsh syntax we refer to its accompanied man page. Suffice to say that assignments and comparisons in ginsh are written as they are in C, i.e. = assigns and == compares.

It can manipulate arbitrary precision integers in a very fast way. Rational numbers are automatically converted to fractions of coprime integers:

> x=3^150;
369988485035126972924700782451696644186473100389722973815184405301748249
> y=3^149;
123329495011708990974900260817232214728824366796574324605061468433916083
> x/y;