[OS X TeX] Macro for multiplying numbers

Claus Gerhardt gerhardt at math.uni-heidelberg.de
Sat Mar 5 21:51:50 EST 2005


I didn't verify, but I guess adding braces will do

> \mul{{\mul{4}{5}}}{6}

Claus

On Mar 6, 2005, at 2:17, Kapila Rohan Attele wrote:

>
> I made  a macro for multiplying integers
>
> \def\mul#1#2{\newcounter{a}\newcounter{b}\setcounter{a}{#1}\setcounter{ 
> b}{#2} \multiply \value{a} by \value{b} \the\value{a}}
>
> It can multiply two integers (correctly), but  given 3 to multiply  
> \mul{\mul{4}{5}}{6} it complains missing number, treated as zero.
> How to define a macro that associativity to multiply more than two?
>
> Rohan Attele
> Chicago State University
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the MacOSX-TeX mailing list