Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The world is no nursery. -- Sigmund Freud


devel / comp.lang.awk / Re: Rounding question (gawk)

SubjectAuthor
o Re: Rounding question (gawk)Janis Papanagnou

1
Re: Rounding question (gawk)

<tv3i0t$2c3gn$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3359&group=comp.lang.awk#3359

  copy link   Newsgroups: comp.lang.awk
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: janis_pa...@hotmail.com (Janis Papanagnou)
Newsgroups: comp.lang.awk
Subject: Re: Rounding question (gawk)
Date: Sat, 18 Mar 2023 06:25:48 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <tv3i0t$2c3gn$1@dont-email.me>
References: <tv1iej$16kf7$1@news.xmission.com> <tv20m6$20vm6$1@dont-email.me>
<20230317210431.683@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 Mar 2023 05:25:49 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="1304a8e9e6cb483b4c642a5889513c8e";
logging-data="2493975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zQwbo4GTxoiNz1YP/cXKC"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:hXtPu5LtlzQXqqvB1SOROGFoAqA=
In-Reply-To: <20230317210431.683@kylheku.com>
 by: Janis Papanagnou - Sat, 18 Mar 2023 05:25 UTC

On 18.03.2023 05:14, Kaz Kylheku wrote:
> On 2023-03-17, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>> On 17.03.2023 12:20, Kenny McCormack wrote:
>>> Second, is it enough to just add 50 before doing the division? I.e., change
>>> it to:
>>>
>>> strftime("%T",($14+$15+50)/100,1)
>>>
>>> Would it be that easy?
>>
>> That depends on your (rounding-)requirements. Your approach is the
>> simple "always upwards rounding at .5", other applications may want
>> to round up or down depending on the preceding digit. (In the GNU
>
> I think, fancy decimal rounding rules are mainly for money?

Given that there had been hacks in the past where sub-cent amounts
in financial transactions had been accumulated on separate fraud
accounts we might get the impression that rounding applications is
least for money. ;-)

My thought where it matters would have been in numerical math, e.g.
in hydrodynamic and/or chaotic systems where rounding accumulations
would matter most.

Anyway, I do most of my computation in non-FP, so I am not too much
concerned, but physicists may be.

Janis


devel / comp.lang.awk / Re: Rounding question (gawk)

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor