[Prev][Next][Index][Thread]
Re: Naive Number Question
-
To: info-dylan@ai.mit.edu
-
Subject: Re: Naive Number Question
-
From: Bruce Hoult <bruce@hoult.org>
-
Date: Sun, 10 Dec 2000 15:30:02 -0500 (EST)
-
Organization: ihug ( New Zealand )
-
References: <200012101830.NAA02527@life.ai.mit.edu>
-
User-Agent: MT-NewsWatcher/3.0 (PPC)
-
Xref: traf.lcs.mit.edu comp.lang.dylan:12882
In article <200012101830.NAA02527@life.ai.mit.edu>, Rob Myers
<robm@onetel.net.uk> wrote:
> Hi.
>
> How can I round a number (a <float>) to the nearest n decimal places in
> (Gwydion) Dylan?
On a binary machine there is no more efficient way to do that than to
multiply it by 10^n, round it, and then multiply by 10^-n.
-- Bruce