CTAN Comprehensive TeX Archive Network

Direc­tory macros/generic/apnum

apnum -- Arbitrary precision numbers implemented by TeX macros
Petr Olsak                                           Dec. 2015

The operations (addition, subtraction, multiplication, division, power to an
integer, square root, exponential, logarithm, sin, cos, tan, asin, acos,
atan) are implemented by TeX macros in this package. Operands can be numbers
with arbitrary number of digits (or scientific notation is allowed). The
expression scanner is provided too. The exhaustive documentation (including
detail TeXnical documentation) is included. The macro includes many
optimizations and uses only TeX primitives (from classical TeX) and
\newcount macro.

Files:  README     ... this file
        apnum.tex  ... TeX macro
        apnum.pdf  ... documentation (generated from apnum.d)
        apnum.d    ... documentation (source for apnum.pdf)

License: Public domain.

1.0 <Nov 2014> - released
1.1 <Jan 2015> - corrections
1.2 <May 2015> - .5+.5=.1 bug fixed
1.3 <Dec 2015> - many improvements, \SQRT, \LN, \EXP implemented
1.4 <Dec 2015> - \SIN, \COS, \TAN, \ASIN, \ACOS, \ATAN, \PI, \PIhalf added
1.5 <Jan 2016> - \eprint for printing evaluated expressions added.
1.6 <Feb 2016> - \evalmdef introduced, \EXP improved.
1.7 <Apr 2018> - \eprint - round braces around an expression with unary minus

Down­load the con­tents of this pack­age in one zip archive (737.7k).

ap­num – Ar­bi­trary pre­ci­sion num­bers im­ple­mented by macros

The ba­sic op­er­a­tions (ad­di­tion, sub­trac­tion, mul­ti­pli­ca­tion, di­vi­sion, power to an in­te­ger) are im­ple­mented by macros in this pack­age. Operands may be num­bers with ar­bi­trary num­bers of dig­its; sci­en­tific no­ta­tion is al­lowed.

The ex­pres­sion scan­ner is also pro­vided.

As of ver­sion 1.4 (De­cem­ber 2015) the cal­cu­la­tion of com­mon func­tions (sqrt, exp, ln, sin, cos, tan, asin, acos, atan, pi) with ar­bi­trary pre­ci­sion in the re­sult has been added.

Ex­haus­tive doc­u­men­ta­tion (in­clud­ing de­tailed nical doc­u­men­ta­tion) is in­cluded. The macro in­cludes many op­ti­miza­tions and uses only prim­i­tives (from clas­sic ) and \new­count macro.

Li­censesPublic Do­main Soft­ware
Main­tainerPetr Olšák
Con­tained inTeX Live as ap­num
MiKTeX as ap­num
Guest Book Sitemap Contact Contact Author