ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Numerical Calculations
Date: Wed, 19 Dec 2012 19:18:05 +0100	[thread overview]
Message-ID: <50D204DD.4000702@wxs.nl> (raw)
In-Reply-To: <CAFP+xFLCFDQiGX2k8Ec9fHtBVmF9EWee+wCvj0yWZphEFLuHXg@mail.gmail.com>

On 12/19/2012 7:09 PM, Troy Henderson wrote:
> Is there a way to for ConTeXt to do basic arithmetic operations?  For
> example,
>
> \calc{1+2} and have it return 3 or
>
> \calc{1/3.8} and have it return 0.263157894736842 (or rounded)

\luaexpr{1+2}

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2012-12-19 18:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 18:09 Troy Henderson
2012-12-19 18:16 ` Thomas A. Schmitz
2012-12-19 18:18 ` Hans Hagen [this message]
2012-12-19 18:19 ` Hans Hagen
2012-12-19 18:43   ` Troy Henderson
2012-12-19 19:19     ` Roland Thiers
2012-12-19 19:26       ` Hans Hagen
2012-12-19 19:25     ` Hans Hagen
     [not found]       ` <CAFP+xFK89EWiM7SbhVvZKPe1Hv2UKNGAgo6B8kaJNaE363dWpA@mail.gmail.com>
     [not found]         ` <CAFP+xFJqt=j-3B1y2LpYj6Xuu19viGScjEea=rN5FtVsotd3yw@mail.gmail.com>
2012-12-19 20:30           ` Hans Hagen
2012-12-19 20:54             ` Troy Henderson
2012-12-19 22:05               ` Marco Patzer
2012-12-19 22:10                 ` Troy Henderson
2012-12-19 23:03                   ` Troy Henderson
2012-12-21 12:22                     ` Andre Caldas
2012-12-21 12:56                       ` Troy Henderson
2012-12-19 23:20                   ` Marco Patzer
2012-12-19 19:32     ` Philipp Gesang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50D204DD.4000702@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).