From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6280 Path: main.gmane.org!not-for-mail From: e_w_g@t-online.de Newsgroups: gmane.comp.tex.context Subject: Re: Calculating in TeX Date: Thu, 06 Dec 2001 15:06:36 +0100 (MET) Sender: owner-ntg-context@let.uu.nl Message-ID: <1007647551.3c0f7b3f27cd3@webmail.t-online.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035396813 9078 80.91.224.250 (23 Oct 2002 18:13:33 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:13:33 +0000 (UTC) Original-To: ntg-context@ntg.nl Xref: main.gmane.org gmane.comp.tex.context:6280 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6280 Tobias Burnus schrieb: > > I have a nice document where I need to perform small > calculation (actually > only calculating the average value): > if((#1+#2+#3) != 0) > (#1*1 + #2*2 + #3*3)/(#1+#2+#3) > else > "--" > > Now I was thinking where I could do so in TeX. (I think > there are some > macros in ConTeXt, but I cannot find them.) > There is the fp package for latex. It provides rather complete fixed-point arithmetic. I have never used it, but probably it is generic enough to work with context. If not, there is the fltpoint package which will definitely work, but it is limited to addition, subtraction, multiplication and division (if-then-else could be done too). Eckhart