ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: Yatskovsky <yatskovsky@gmail.com>
Cc: "ntg-context-request@ntg.nl" <ntg-context@ntg.nl>
Subject: Re: luatex for random numbers
Date: Thu, 27 Sep 2007 18:51:19 +0200	[thread overview]
Message-ID: <46FBDF87.2000905@wxs.nl> (raw)
In-Reply-To: <176695508.20070927193131@gmail.com>

Vyatcheslav Yatskovsky wrote:
> Hello Hans,
> 
> Thanks. Is there any way to print a number in hex or bin form? (Either using lua or tex facilities?) I already know how to generate random integer numbers, 
> \ctxlua{tex.print(math.random(30,60)) ;}
> now I need to represent them as binary or hexadecimal.

you can use string.format

if you wanna use lua seriously, it makes sense to buy the book ... easy 
reading, very complete and inexpensive

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2007-09-27 16:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2030.1190571897.2346.ntg-context@ntg.nl>
2007-09-24 14:12 ` still waiting for mswincontext Vyatcheslav Yatskovsky
2007-09-25 22:02   ` Mojca Miklavec
2007-09-26  7:50     ` Hans Hagen
2007-09-26 10:40       ` Vyatcheslav Yatskovsky
2007-09-26 10:48         ` Hans Hagen
2007-09-26 21:10           ` Vyatcheslav Yatskovsky
     [not found]             ` <46FADBC9.2000701@wxs.nl>
     [not found]               ` <395920886.20070927015311@gmail.com>
     [not found]                 ` <46FB6EF1.4080701@wxs.nl>
     [not found]                   ` <803860895.20070927132407@gmail.com>
     [not found]                     ` <46FB8855.1050504@wxs.nl>
2007-09-27 15:52                       ` luatex for random numbers Vyatcheslav Yatskovsky
2007-09-27 15:57                         ` Hans Hagen
2007-09-27 16:31                           ` Vyatcheslav Yatskovsky
2007-09-27 16:51                             ` Hans Hagen [this message]
2007-09-30 17:22           ` still waiting for mswincontext Joel C. Salomon
2007-09-30 18:47             ` Hans Hagen
2007-09-30 22:13               ` Joel C. Salomon
2007-09-30 22:40                 ` Hans Hagen
2007-10-01  2:22                   ` Joel C. Salomon

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=46FBDF87.2000905@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    --cc=yatskovsky@gmail.com \
    /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).