Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Linux, the way to get rid of boot viruses -- MaDsen Wikholm, mwikholm@at8.abo.fi


computers / comp.os.vms / Re: VMS Software Q1 '23 Update

SubjectAuthor
* VMS Software Q1 '23 UpdateJan-Erik Söderholm
`* Re: VMS Software Q1 '23 UpdateSimon Clubley
 `* Re: VMS Software Q1 '23 UpdateJan-Erik Söderholm
  `* Re: VMS Software Q1 '23 UpdateJohn H Reinhardt
   `* Re: VMS Software Q1 '23 UpdateIan Miller
    `* Re: VMS Software Q1 '23 UpdateSimon Clubley
     +* Re: VMS Software Q1 '23 UpdateDave Froble
     |+- Re: VMS Software Q1 '23 UpdateDan Cross
     |+* Re: VMS Software Q1 '23 UpdateCraig A. Berry
     ||`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     || +* Re: VMS Software Q1 '23 UpdateCraig A. Berry
     || |`- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     || `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||  `* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||   +- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||   `* Re: VMS Software Q1 '23 UpdateJohn Reagan
     ||    `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||     `* Re: VMS Software Q1 '23 UpdateJohn Reagan
     ||      `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       +* Re: VMS Software Q1 '23 UpdateJohn Reagan
     ||       |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       | `* Re: VMS Software Q1 '23 Updatebill
     ||       |  +- Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |  `* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |   +- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |   `* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |    `* Re: VMS Software Q1 '23 UpdateSingle Stage to Orbit
     ||       |     `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      +* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |      |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | +* Re: VMS Software Q1 '23 UpdateSteven Schweda
     ||       |      | |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | | +- Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |      | | `* Re: VMS Software Q1 '23 UpdateSteven Schweda
     ||       |      | |  +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  |+* Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||+* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  |||+* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||||`- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  |||`- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||`* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  || `* Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||  +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||  |`* Re: VMS Software Q1 '23 Updatebill
     ||       |      | |  ||  | +- Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||  | +- Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||  | `- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||  `* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   |+* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   ||`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || +* Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||   || |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | +* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   || | |+- Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||   || | |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | +- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | +* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   || | | |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | | +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | | |`- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | | `* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   || | | |  +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | |  |+* Re: VMS Software Q1 '23 UpdateCraig A. Berry
     ||       |      | |  ||   || | | |  ||`- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | |  |`* Re: VMS Software Q1 '23 UpdateJohn Reagan
     ||       |      | |  ||   || | | |  | `- Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   || | | |  `- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || | | `- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||   || | `* Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||   || |  `- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || +* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |      | |  ||   || |+- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |`* Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||   || | `* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |      | |  ||   || |  +* Re: VMS Software Q1 '23 UpdateStephen Hoffman
     ||       |      | |  ||   || |  |+- Re: VMS Software Q1 '23 UpdateJohn Reagan
     ||       |      | |  ||   || |  |`* Re: VMS Software Q1 '23 UpdateSimon Clubley
     ||       |      | |  ||   || |  | +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |  | |+* Re: VMS Software Q1 '23 UpdateJan-Erik Söderholm
     ||       |      | |  ||   || |  | ||`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |  | || `- Re: VMS Software Q1 '23 UpdateJan-Erik Söderholm
     ||       |      | |  ||   || |  | |`* Re: VMS Software Q1 '23 UpdateSingle Stage to Orbit
     ||       |      | |  ||   || |  | | `* Re: VMS Software Q1 '23 Updateplugh
     ||       |      | |  ||   || |  | |  +* Re: VMS Software Q1 '23 UpdateSingle Stage to Orbit
     ||       |      | |  ||   || |  | |  |`* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |  | |  | +* Re: VMS Software Q1 '23 UpdateSingle Stage to Orbit
     ||       |      | |  ||   || |  | |  | |`- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |  | |  | `* Re: VMS Software Q1 '23 UpdateDan Cross
     ||       |      | |  ||   || |  | |  |  `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | |  ||   || |  | |  |   `- Re: VMS Software Q1 '23 UpdateDan Cross
     ||       |      | |  ||   || |  | |  `- Re: VMS Software Q1 '23 Updateplugh
     ||       |      | |  ||   || |  | +- Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  ||   || |  | +* Re: Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMS Software Q1 Stephen Hoffman
     ||       |      | |  ||   || |  | |`* Re: Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMSArne Vajhøj
     ||       |      | |  ||   || |  | | `* Re: Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMSDan Cross
     ||       |      | |  ||   || |  | |  `- Re: Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMSArne Vajhøj
     ||       |      | |  ||   || |  | `- Re: VMS Software Q1 '23 UpdateDan Cross
     ||       |      | |  ||   || |  `- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||   || `- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||   |`- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  ||   +* Re: VMS Software Q1 '23 UpdateScott Dorsey
     ||       |      | |  ||   +* Re: VMS Software Q1 '23 Updatebill
     ||       |      | |  ||   `- Re: VMS Software Q1 '23 UpdateJohnny Billquist
     ||       |      | |  |`* Re: VMS Software Q1 '23 UpdateDave Froble
     ||       |      | |  `* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      | `- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     ||       |      `* Re: VMS Software Q1 '23 UpdateSingle Stage to Orbit
     ||       `* Re: VMS Software Q1 '23 UpdateDave Froble
     |`- Re: VMS Software Q1 '23 UpdateIan Miller
     +* Re: VMS Software Q1 '23 UpdateCraig A. Berry
     +- Re: VMS Software Q1 '23 UpdateArne Vajhøj
     +* Re: VMS Software Q1 '23 UpdateArne Vajhøj
     `- Re: VMS Software Q1 '23 UpdateArne Vajhøj

Pages:123456
Re: VMS Software Q1 '23 Update

<2f0e9822-a4ef-4366-ad4d-c1593fce7eden@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26334&group=comp.os.vms#26334

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a0c:b208:0:b0:534:3c7d:97fc with SMTP id x8-20020a0cb208000000b005343c7d97fcmr2348946qvd.11.1674775166355;
Thu, 26 Jan 2023 15:19:26 -0800 (PST)
X-Received: by 2002:a0c:fe63:0:b0:535:182a:7b51 with SMTP id
b3-20020a0cfe63000000b00535182a7b51mr1417389qvv.6.1674775166163; Thu, 26 Jan
2023 15:19:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Thu, 26 Jan 2023 15:19:25 -0800 (PST)
In-Reply-To: <tquuop$1bq64$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=71.80.99.242; posting-account=M3IgSwoAAADJd6EnOmsrCCfB6_OyTOkv
NNTP-Posting-Host: 71.80.99.242
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me> <092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me> <9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me> <tqsldr$t9n1$1@dont-email.me>
<tqso8d$tit2$1@dont-email.me> <tqt8o4$138od$1@dont-email.me>
<tqu0v2$1724s$2@dont-email.me> <tqu2ul$17ik2$1@dont-email.me> <tquuop$1bq64$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2f0e9822-a4ef-4366-ad4d-c1593fce7eden@googlegroups.com>
Subject: Re: VMS Software Q1 '23 Update
From: xyzzy1...@gmail.com (John Reagan)
Injection-Date: Thu, 26 Jan 2023 23:19:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5192
 by: John Reagan - Thu, 26 Jan 2023 23:19 UTC

On Thursday, January 26, 2023 at 5:27:41 PM UTC-5, Arne Vajhøj wrote:
> On 1/26/2023 9:32 AM, Arne Vajhøj wrote:
> > I do not think the exact same problem can be recreated in
> > Basic (as far as I can read the documentation then Basic
> > does not allow static initialization in map's).
> >
> > But to show something in Basic it is easy to do with
> > assignment:
> >
> > program p
> >
> > map (d) long lw1, long lw2
> >
> > external sub s1, s2
> >
> > lw1 = 1
> > lw2 = 2
> >
> > call s1
> > call s2
> >
> > print lw1, lw2
> >
> > end program
> > !
> > sub s1
> >
> > map (d) word w1, word w2, word w3, word w4
> >
> > w2 = 1
> > w4 = 2
> >
> > end sub
> > !
> > sub s2
> >
> > map (d) byte b1, byte b2, byte b3, byte b4, byte b5, byte b6, byte b7,
> > byte b8
> >
> > b4 = 1
> > b8 = 2
> >
> > end sub
> >
> > $ bas p
> > $ lin p
> > $ r p
> > 16842753 33685506
> The Fortran version with static initialization (using data statements!)
> and no calls:
>
> $ type p2x.for
> program p2
> integer*4 lw1,lw2
> common /d/lw1,lw2
> data lw1/1/,lw2/2/
> write(*,*) lw1,lw2
> end
> $ for p2x
> $ type s1.for
> subroutine s1
> integer*2 w1,w2,w3,w4
> common /d/w1,w2,w3,w4
> data w2/1/,w4/2/
> end
> $ for s1
> $ type s2.for
> subroutine s2
> integer*1 b1,b2,b3,b4,b5,b6,b7,b8
> common /d/b1,b2,b3,b4,b5,b6,b7,b8
> data b4/1/,b8/2/
> end
> $ for s2
> $ link p2x + s1 + s2
> $ run p2x
> 16842753 33685506
> $ link p2x + s2 + s1
> $ run p2x
> 65537 131074
>
> (tested on VMS Alpha)
>
> The order of the OBJ files in the link command change the output.
>
> Yuck.
>
> Arne
Correct. My example was a condensed version of the problem report.
The original was multiple modules. My example is the worst case scenario
(both in terms of what the compiler has to handle and in terms of my sense
of decency). The static initializations is what I didn't consider in the past.

For BASIC, the example of

map (d) long lw1, long lw2

probably would accidentally create 4 longwords due to how BASIC describes
it to GEM. I didn't take a full survey of all the frontends back at the initial G2L
design. Mostly focused on C & BLISS (to boot the OS) followed by Fortran
and COBOL (we knew that packed decimal and complex needed special
attention).

And yes, I think Dave asked earlier. All of the frontends (C++ is different)
continue to generate GEM CIL and GEM symbol table. Having each frontend
generate its own LLVM IR would be much more work and you run the risk
of introducing subtle differences. Having the single conversion in G2L
is much better. The LLVM interface (which is in C++ and would be hard to
code to from BLISS-based frontends without an extensive set of jacket
routines [yes, LLVM has a C-based interface but it not well supported])
isn't upward compatible. We had to make changes to the G2L code from
the version that interfaces to the LLVM used for the cross compilers and
the newer LLVM used for the native compilers. Only a single place to change
by having G2L.

Re: VMS Software Q1 '23 Update

<tr162i$1q43n$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26338&group=comp.os.vms#26338

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Fri, 27 Jan 2023 18:44:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <tr162i$1q43n$3@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me> <tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net> <26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com> <tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me> <092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com> <tqsar7$rhss$1@dont-email.me> <9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com> <tqsf7p$s7a0$1@dont-email.me> <660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net> <tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me> <9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu> <tquhac$19r40$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 27 Jan 2023 18:44:35 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="52de379789313db982ed74f06b54580e";
logging-data="1904759"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19e/4vAOJtk0y2WVWQsI813mQTiKBEKUAw="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:3n2BPzqxiY6zujdhNpgGnFdf/JQ=
 by: Simon Clubley - Fri, 27 Jan 2023 18:44 UTC

On 2023-01-26, Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 1/26/2023 12:05 PM, Single Stage to Orbit wrote:
>> On Thu, 2023-01-26 at 11:50 -0500, Dave Froble wrote:
>>>> I am of the opinion that direct testing for equality of floating
>>>> point numbers should be disallowed by every language and that
>>>> people should be forced to use an alternative where _they_ have to
>>>> specify the delta value that 2 numbers should be within before they
>>>> are considered to be equal.
>>>
>>> Well, "have to" or not, that is the only method that works ...
>>
>> Or use rounding: IF Math.Round(x,2) = Math.Round(x,2) THEN ..

You are still directly comparing two approximations and as Arne points
out, it's not the same thing as using a delta value

>
> VB.NET?
>
> IF Math.Round(x,2) = Math.Round(y,2) THEN
>
> and:
>
> IF Math.Abs(x - y) < 0.01 THEN
>
> are not fully equivalent.
>

This is the only method that is truly robust when you are comparing
approximations instead of exact values.

(This assumes Abs() in the above example is really a floating point Abs()
instead of an integer Abs()).

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: VMS Software Q1 '23 Update

<bc075fb6ea8d080fea622a07167ec37fdc8b4a91.camel@munted.eu>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26340&group=comp.os.vms#26340

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!palladium.buellnet!not-for-mail
From: alex.bu...@munted.eu (Single Stage to Orbit)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Fri, 27 Jan 2023 18:42:58 +0000
Organization: One very high maintenance cat
Message-ID: <bc075fb6ea8d080fea622a07167ec37fdc8b4a91.camel@munted.eu>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me>
Reply-To: alex.buell@munted.eu
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: solani.org;
logging-data="159455"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Evolution 3.46.2
Cancel-Lock: sha1:yvmJkMIspUHuZiTv9KA+NhvHrPI=
X-User-ID: eJwFwQkBACAIA8BKgjwjjiLrH8E73yHRaeFhTucllslBUm0U6TUl/a7Wqu1WZ9AAhXyCReL0TR0O/I1lflHOFfE=
In-Reply-To: <tquhac$19r40$1@dont-email.me>
 by: Single Stage to Orbi - Fri, 27 Jan 2023 18:42 UTC

On Thu, 2023-01-26 at 13:38 -0500, Arne Vajhøj wrote:
> > Or use rounding: IF Math.Round(x,2) = Math.Round(x,2) THEN ..
>
> VB.NET?
>
> IF Math.Round(x,2) = Math.Round(y,2) THEN
>
> and:
>
> IF Math.Abs(x - y) < 0.01 THEN
>
> are not fully equivalent.

Of course they aren't. But it is good enough for our purposes.
--
Tactical Nuclear Kittens

Re: VMS Software Q1 '23 Update

<tr1qi4$1tk7m$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26343&group=comp.os.vms#26343

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Fri, 27 Jan 2023 19:34:10 -0500
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tr1qi4$1tk7m$2@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me>
<bc075fb6ea8d080fea622a07167ec37fdc8b4a91.camel@munted.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 28 Jan 2023 00:34:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2019574"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WIIWxdtYhWJ0u7X/vkZ2ivgEgOQ8lDaI="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:lhkAa69YgF37m/gPySEhlZP4vFk=
In-Reply-To: <bc075fb6ea8d080fea622a07167ec37fdc8b4a91.camel@munted.eu>
Content-Language: en-US
 by: Arne Vajhøj - Sat, 28 Jan 2023 00:34 UTC

On 1/27/2023 1:42 PM, Single Stage to Orbit wrote:
> On Thu, 2023-01-26 at 13:38 -0500, Arne Vajhøj wrote:
>>> Or use rounding: IF Math.Round(x,2) = Math.Round(x,2) THEN ..
>>
>> VB.NET?
>>
>> IF Math.Round(x,2) = Math.Round(y,2) THEN
>>
>> and:
>>
>> IF Math.Abs(x - y) < 0.01 THEN
>>
>> are not fully equivalent.
>
> Of course they aren't. But it is good enough for our purposes.

I am not saying that one is better than the other
just that for some cases the test results will be
different.

Arne

Re: VMS Software Q1 '23 Update

<tr1r6f$1tk7m$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26344&group=comp.os.vms#26344

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Fri, 27 Jan 2023 19:45:01 -0500
Organization: A noiseless patient Spider
Lines: 65
Message-ID: <tr1r6f$1tk7m$3@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 28 Jan 2023 00:45:03 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2019574"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196Zq4gKj7GHeX3NV8NuWlYX50SqdKaTZI="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:lXwunZVBA/PlXo7QxN5P829pIqY=
Content-Language: en-US
In-Reply-To: <tr162i$1q43n$3@dont-email.me>
 by: Arne Vajhøj - Sat, 28 Jan 2023 00:45 UTC

On 1/27/2023 1:44 PM, Simon Clubley wrote:
> On 2023-01-26, Arne Vajhøj <arne@vajhoej.dk> wrote:
>> On 1/26/2023 12:05 PM, Single Stage to Orbit wrote:
>>> On Thu, 2023-01-26 at 11:50 -0500, Dave Froble wrote:
>>>>> I am of the opinion that direct testing for equality of floating
>>>>> point numbers should be disallowed by every language and that
>>>>> people should be forced to use an alternative where _they_ have to
>>>>> specify the delta value that 2 numbers should be within before they
>>>>> are considered to be equal.
>>>>
>>>> Well, "have to" or not, that is the only method that works ...
>>>
>>> Or use rounding: IF Math.Round(x,2) = Math.Round(x,2) THEN ..
>
> You are still directly comparing two approximations

..NET spec for Round guarantees the best approximation.

> and as Arne points
> out, it's not the same thing as using a delta value

Yep.

>> VB.NET?
>>
>> IF Math.Round(x,2) = Math.Round(y,2) THEN
>>
>> and:
>>
>> IF Math.Abs(x - y) < 0.01 THEN
>>
>> are not fully equivalent.
>
> This is the only method that is truly robust when you are comparing
> approximations instead of exact values.

I think the optimal method depends on the context. And even
with the last method there is the big question of what is the right
value for the epsilon - there is no magic right answer.

In some contexts the relative difference may be better than the
absolute difference:

IF Math.Abs(x / y - 1.0) < 0.001 THEN

> (This assumes Abs() in the above example is really a floating point Abs()
> instead of an integer Abs()).

..NET has 8 overloads of Abs:

Abs(double) -> double
Abs(decimal) -> decimal
Abs(double,int) -> double
Abs(decimal,int) -> decimal
Abs(double,roundingmode) -> double
Abs(decimal,roundingmode) -> decimal
Abs(double,int,roundingmode) -> double
Abs(decimal,int,roundingmode) -> decimal

Arne

Re: VMS Software Q1 '23 Update

<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26346&group=comp.os.vms#26346

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:5ec5:b0:537:68ae:a48 with SMTP id mn5-20020a0562145ec500b0053768ae0a48mr897534qvb.72.1674884781103;
Fri, 27 Jan 2023 21:46:21 -0800 (PST)
X-Received: by 2002:a05:620a:113c:b0:706:4d9d:e325 with SMTP id
p28-20020a05620a113c00b007064d9de325mr2234167qkk.419.1674884780945; Fri, 27
Jan 2023 21:46:20 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Fri, 27 Jan 2023 21:46:20 -0800 (PST)
In-Reply-To: <tr1r6f$1tk7m$3@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=76.76.60.100; posting-account=OjKUgAkAAAAXAqdVEKd-Gc8RltEUx3Xq
NNTP-Posting-Host: 76.76.60.100
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me> <092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me> <9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me> <660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me> <tr1r6f$1tk7m$3@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
Subject: Re: VMS Software Q1 '23 Update
From: sms.anti...@gmail.com (Steven Schweda)
Injection-Date: Sat, 28 Jan 2023 05:46:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2839
 by: Steven Schweda - Sat, 28 Jan 2023 05:46 UTC

> I am not saying that one is better than the other [...]

I am. A reasonable test for approximate equality looks for a "small"
(absolute) difference between two values. Expecting two extremely close
values to round to the same value is not reasonable. (That is, it
doesn't always happen.)

"Equal when rounded" might seem plausible at first glance, but (even)
a little thought would reveal that it's an inferior test (because it
gives goofy results for values close to a round-down/up decision value).

> I think the optimal method depends on the context. And even
> with the last method there is the big question of what is the right
> value for the epsilon - there is no magic right answer.

Choosing a good parameter for a good test is important, but choosing
a good parameter for a good test should not be confused with choosing
between a good test and a foolish test.

Re: VMS Software Q1 '23 Update

<tr3b4c$28ikb$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26347&group=comp.os.vms#26347

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 09:23:05 -0500
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <tr3b4c$28ikb$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 28 Jan 2023 14:23:08 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2378379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sOeGtqGbqOcJbgdF6N+/XRDxAL08+G3Y="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:9n2pKzXKL+XgTM6hJ0y552FZTUM=
Content-Language: en-US
In-Reply-To: <tr1r6f$1tk7m$3@dont-email.me>
 by: Arne Vajhøj - Sat, 28 Jan 2023 14:23 UTC

On 1/27/2023 7:45 PM, Arne Vajhøj wrote:
> In some contexts the relative difference may be better than the
> absolute difference:
>
> IF Math.Abs(x / y - 1.0) < 0.001 THEN

25 years ago I liked this one:

const double FP_SMALL = 0.000001;
const double FP_ABS_SMALL_1 = -FP_SMALL;
const double FP_ABS_SMALL_2 = FP_SMALL;
const double FP_REL_SMALL_1 = 1-FP_SMALL;
const double FP_REL_SMALL_2 = 1+FP_SMALL;

BOOL num_eq(double x1,double x2)
{ double d;
if((-1<x2)&&(x2<1)) {
d = x1 - x2;
return ((FP_ABS_SMALL_1<d)&&(d<FP_ABS_SMALL_2));
} else {
d = x1 / x2;
return ((FP_REL_SMALL_1<d)&&(d<FP_REL_SMALL_2));
}
}

Apparently I did not like space around operators back then.

Arne

Re: VMS Software Q1 '23 Update

<tr3bd5$28ikb$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26348&group=comp.os.vms#26348

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 09:27:46 -0500
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <tr3bd5$28ikb$2@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 28 Jan 2023 14:27:49 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2378379"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uU2XqH044+qhGcrlV26RnzxsI0Rjh+wc="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:LDO0umNeDa+yYYyhJKXbQigRMz0=
Content-Language: en-US
In-Reply-To: <435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
 by: Arne Vajhøj - Sat, 28 Jan 2023 14:27 UTC

On 1/28/2023 12:46 AM, Steven Schweda wrote:
>> I am not saying that one is better than the other [...]
>
> I am. A reasonable test for approximate equality looks for a "small"
> (absolute) difference between two values.

Absolute difference is sensitive to the scale
of the data.

Sometimes relative difference makes more sense.

> Expecting two extremely close
> values to round to the same value is not reasonable. (That is, it
> doesn't always happen.)
>
> "Equal when rounded" might seem plausible at first glance, but (even)
> a little thought would reveal that it's an inferior test (because it
> gives goofy results for values close to a round-down/up decision value).

Consider the case where the numbers represent money.

The difference between 2.494 dollar/euro and 2.496 dollar/euro
are less than 0.01 but ...

Arne

Re: VMS Software Q1 '23 Update

<tr3f0i$299sb$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26349&group=comp.os.vms#26349

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 15:29:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <tr3f0i$299sb$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me> <tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net> <26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com> <tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me> <092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com> <tqsar7$rhss$1@dont-email.me> <9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com> <tqsf7p$s7a0$1@dont-email.me> <660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net> <tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me> <9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu> <tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me> <tr1r6f$1tk7m$3@dont-email.me> <435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com> <tr3bd5$28ikb$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 28 Jan 2023 15:29:22 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="1345c85544c00e4d668e7662678f1e11";
logging-data="2402187"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eKFqDtXlTTkUB5NaoEF+JLNALFfai208="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:JmAY5fcQNdkn2OD5HD8onQuQyPE=
 by: Simon Clubley - Sat, 28 Jan 2023 15:29 UTC

On 2023-01-28, Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 1/28/2023 12:46 AM, Steven Schweda wrote:
>>> I am not saying that one is better than the other [...]
>>
>> I am. A reasonable test for approximate equality looks for a "small"
>> (absolute) difference between two values.
>
> Absolute difference is sensitive to the scale
> of the data.
>
> Sometimes relative difference makes more sense.
>
>> Expecting two extremely close
>> values to round to the same value is not reasonable. (That is, it
>> doesn't always happen.)
> >
>> "Equal when rounded" might seem plausible at first glance, but (even)
>> a little thought would reveal that it's an inferior test (because it
>> gives goofy results for values close to a round-down/up decision value).
>
> Consider the case where the numbers represent money.
>
> The difference between 2.494 dollar/euro and 2.496 dollar/euro
> are less than 0.01 but ...
>

Hmmm. Do you own a red stapler by any chance ? :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: VMS Software Q1 '23 Update

<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26355&group=comp.os.vms#26355

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ae9:e40a:0:b0:702:2939:8cf5 with SMTP id q10-20020ae9e40a000000b0070229398cf5mr2184502qkc.75.1674936068970;
Sat, 28 Jan 2023 12:01:08 -0800 (PST)
X-Received: by 2002:a05:622a:1b1e:b0:3a8:abc:c68d with SMTP id
bb30-20020a05622a1b1e00b003a80abcc68dmr2462348qtb.66.1674936068741; Sat, 28
Jan 2023 12:01:08 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 28 Jan 2023 12:01:08 -0800 (PST)
In-Reply-To: <tr3bd5$28ikb$2@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=76.76.60.100; posting-account=OjKUgAkAAAAXAqdVEKd-Gc8RltEUx3Xq
NNTP-Posting-Host: 76.76.60.100
References: <tq8dgc$r4km$1@dont-email.me> <tq8r16$tc7h$2@dont-email.me>
<tq9087$r4km$2@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me> <092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me> <9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me> <660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me> <435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
Subject: Re: VMS Software Q1 '23 Update
From: sms.anti...@gmail.com (Steven Schweda)
Injection-Date: Sat, 28 Jan 2023 20:01:08 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2957
 by: Steven Schweda - Sat, 28 Jan 2023 20:01 UTC

> [...] a "small" (absolute) difference between two values. [...]

> Absolute difference is sensitive to the scale
> of the data.

_My_ "absolute" was in the sense of "absolute value", as in
Math.Abs(). Any dependence on the scale was built into '"small"', not
"absolute". Hence the quotation marks around '"small"'.

> Consider the case where the numbers represent money.

Who cares what the numbers represent? For example, if you round to
the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
but one rounds to 1, and the other to 2, so the lame test says that
they're "unequal". And 1.50001 and 2.49999 differ by 0.99998, but they
both round to 2, so the lame test says that they're "equal". Any test
which treats a difference of 0.00002 as significant, and a difference of
0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
of what the numbers might represent.

Re: VMS Software Q1 '23 Update

<tr47v2$2dje6$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26358&group=comp.os.vms#26358

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 17:35:11 -0500
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <tr47v2$2dje6$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq9087$r4km$2@dont-email.me>
<k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 28 Jan 2023 22:35:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2543046"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KMprdE5v0EU6tpdwJW0ZDKqpCKVer+cg="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:aNzlkR6DsfHWHpTJ6kTaCYhRlM4=
Content-Language: en-US
In-Reply-To: <4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
 by: Arne Vajhøj - Sat, 28 Jan 2023 22:35 UTC

On 1/28/2023 3:01 PM, Steven Schweda wrote:
>> Consider the case where the numbers represent money.
>
> Who cares what the numbers represent? For example, if you round to
> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
> but one rounds to 1, and the other to 2, so the lame test says that
> they're "unequal". And 1.50001 and 2.49999 differ by 0.99998, but they
> both round to 2, so the lame test says that they're "equal". Any test
> which treats a difference of 0.00002 as significant, and a difference of
> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
> of what the numbers might represent.

There are some specific rules for money usually about
always rounding 2 digits.

1494 dollars divided by 1000 = 1.494 get rounded to 1.49
diff 0.002 not equal
1496 dollars divided by 1000 = 1.496 get rounded to 1.50

1496 dollars divided by 1000 = 1.496 get rounded to 1.50
diff 0.008 equal
1504 dollars divided by 1000 = 1.504 get rounded to 1.50

Arne

PS: One should never use traditional binary based floating
point for storing money instead use some decimal based
type. But sometimes calculations switch to floating point
anyway.

Re: VMS Software Q1 '23 Update

<tr48g2$2dm56$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26359&group=comp.os.vms#26359

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 17:44:16 -0500
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <tr48g2$2dm56$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tq9087$r4km$2@dont-email.me>
<k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 28 Jan 2023 22:44:18 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="acf9b6211a10d3bd94239f1e728a28dd";
logging-data="2545830"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/c4ovVLT6xHpA5MpikY1yn0KpHBY9aF40="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:z2bwfv3qFOo76oJ7ayEfQICpGaw=
Content-Language: en-US
In-Reply-To: <4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
 by: Arne Vajhøj - Sat, 28 Jan 2023 22:44 UTC

On 1/28/2023 3:01 PM, Steven Schweda wrote:
>> [...] a "small" (absolute) difference between two values. [...]
>> Absolute difference is sensitive to the scale
>> of the data.
>
> _My_ "absolute" was in the sense of "absolute value", as in
> Math.Abs(). Any dependence on the scale was built into '"small"', not
> "absolute". Hence the quotation marks around '"small"'.

Yes.

But it can be difficult to determine upfront what a good value
for small it with absolute if one does not know the magnitude of
the numbers up front.

Relative difference is much more robust for that problem.

But relative difference has a problem with numbers
close to zero.

Arne

Re: VMS Software Q1 '23 Update

<tr4aii$7ba$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26360&group=comp.os.vms#26360

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.185.159.157.200!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sun, 29 Jan 2023 00:19:45 +0100
Organization: MGT Consulting
Message-ID: <tr4aii$7ba$1@news.misty.com>
References: <tq8dgc$r4km$1@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 28 Jan 2023 23:19:47 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="185.159.157.200";
logging-data="7530"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.13.1
Content-Language: en-US
In-Reply-To: <tr47v2$2dje6$1@dont-email.me>
 by: Johnny Billquist - Sat, 28 Jan 2023 23:19 UTC

On 2023-01-28 23:35, Arne Vajhøj wrote:
> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>> Consider the case where the numbers represent money.
>>
>>     Who cares what the numbers represent?  For example, if you round to
>> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
>> but one rounds to 1, and the other to 2, so the lame test says that
>> they're "unequal".  And 1.50001 and 2.49999 differ by 0.99998, but they
>> both round to 2, so the lame test says that they're "equal".  Any test
>> which treats a difference of 0.00002 as significant, and a difference of
>> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
>> of what the numbers might represent.
>
> There are some specific rules for money usually about
> always rounding 2 digits.
>
> 1494 dollars divided by 1000 = 1.494 get rounded to 1.49
>                               diff 0.002          not equal
> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>
> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>                               diff 0.008            equal
> 1504 dollars divided by 1000 = 1.504 get rounded to 1.50
>
> Arne
>
> PS: One should never use traditional binary based floating
>     point for storing money instead use some decimal based
>     type. But sometimes calculations switch to floating point
>     anyway.

So by your own example, two values differing by 0.002 could be
considered not equal, but two values differing by 0.008 could be
considered equal. Don't you see that this leads to a very bad algorithm
for comparing for approximate equal?

More generally, 0.002 of difference might be considered equal or not
equal purely based on what the actual values are. For some, they will be
equal, and for some others not. The delta that is required for two
numbers to be considered unequal varies based on what the actual numbers
are.

At least in my book, that is a clear indication that it's a very bad method.

Johnny

Re: VMS Software Q1 '23 Update

<d5f62077-c445-4f82-b8e5-7e671188a5bbn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26361&group=comp.os.vms#26361

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:1188:b0:3b8:525f:f0a3 with SMTP id m8-20020a05622a118800b003b8525ff0a3mr109508qtk.157.1674949004429;
Sat, 28 Jan 2023 15:36:44 -0800 (PST)
X-Received: by 2002:a05:620a:424a:b0:71a:498d:1880 with SMTP id
w10-20020a05620a424a00b0071a498d1880mr181280qko.130.1674949004232; Sat, 28
Jan 2023 15:36:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sat, 28 Jan 2023 15:36:43 -0800 (PST)
In-Reply-To: <tr48g2$2dm56$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=76.76.60.100; posting-account=OjKUgAkAAAAXAqdVEKd-Gc8RltEUx3Xq
NNTP-Posting-Host: 76.76.60.100
References: <tq8dgc$r4km$1@dont-email.me> <tq9087$r4km$2@dont-email.me>
<k2qh00Fdet2U1@mid.individual.net> <26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com> <tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com> <tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$1@dont-email.me>
<k3e21sF25rU1@mid.individual.net> <tqtubd$16nj8$1@dont-email.me>
<tquavs$18vru$1@dont-email.me> <9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me> <435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me> <4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr48g2$2dm56$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d5f62077-c445-4f82-b8e5-7e671188a5bbn@googlegroups.com>
Subject: Re: VMS Software Q1 '23 Update
From: sms.anti...@gmail.com (Steven Schweda)
Injection-Date: Sat, 28 Jan 2023 23:36:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2464
 by: Steven Schweda - Sat, 28 Jan 2023 23:36 UTC

> But it can be difficult to determine upfront what a good value
> for small it with absolute if one does not know the magnitude of
> the numbers up front.

The magnitude of the numbers might not matter as much as the number
of bits in the mantissa.

Everything's complicated, but a bad method (like, say, comparing
rounded values) is still a bad method. (I claim.)

Re: VMS Software Q1 '23 Update

<tr4ee9$2egm5$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26362&group=comp.os.vms#26362

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 19:25:42 -0500
Organization: A noiseless patient Spider
Lines: 56
Message-ID: <tr4ee9$2egm5$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me> <tr4aii$7ba$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 00:25:45 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="85c94694e2923b280908bdfbe0b5f4f1";
logging-data="2572997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+GmzwvKo8doYll8mjvj7/Lw9/zqeu3qZc="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:QZXKRx3TDzpr0XL7w2o1C+SLz64=
Content-Language: en-US
In-Reply-To: <tr4aii$7ba$1@news.misty.com>
 by: Arne Vajhøj - Sun, 29 Jan 2023 00:25 UTC

On 1/28/2023 6:19 PM, Johnny Billquist wrote:
> On 2023-01-28 23:35, Arne Vajhøj wrote:
>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>> Consider the case where the numbers represent money.
>>>
>>>     Who cares what the numbers represent?  For example, if you round to
>>> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
>>> but one rounds to 1, and the other to 2, so the lame test says that
>>> they're "unequal".  And 1.50001 and 2.49999 differ by 0.99998, but they
>>> both round to 2, so the lame test says that they're "equal".  Any test
>>> which treats a difference of 0.00002 as significant, and a difference of
>>> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
>>> of what the numbers might represent.
>>
>> There are some specific rules for money usually about
>> always rounding 2 digits.
>>
>> 1494 dollars divided by 1000 = 1.494 get rounded to 1.49
>>                                diff 0.002          not equal
>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>>
>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>>                                diff 0.008            equal
>> 1504 dollars divided by 1000 = 1.504 get rounded to 1.50

> So by your own example, two values differing by 0.002 could be
> considered not equal, but two values differing by 0.008 could be
> considered equal. Don't you see that this leads to a very bad algorithm
> for comparing for approximate equal?
>
> More generally, 0.002 of difference might be considered equal or not
> equal purely based on what the actual values are. For some, they will be
> equal, and for some others not. The delta that is required for two
> numbers to be considered unequal varies based on what the actual numbers
> are.
>
> At least in my book, that is a clear indication that it's a very bad
> method.

I am not sure that I get your point.

This is how rounding of money works.

Software that operate on money needs to implement
the rules.

Same reason that good rounding supports different
rounding mode: UP (round .5 up), EVEN (round .5 to
even) etc.. Different places has different rules and
the software need to implement those.

Arne

Re: VMS Software Q1 '23 Update

<tr4hd3$2ffm6$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26363&group=comp.os.vms#26363

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:16:08 -0500
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <tr4hd3$2ffm6$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <k2qh00Fdet2U1@mid.individual.net>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:16:20 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="bc31521357dd02b4d8b97df8b8273f59";
logging-data="2604742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182RQv/OJl090/6rse7cMxJ0TtEeCeWCzc="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:13sv1qPQJKVP0w96FU20XnBjrkw=
In-Reply-To: <tr47v2$2dje6$1@dont-email.me>
 by: Dave Froble - Sun, 29 Jan 2023 01:16 UTC

On 1/28/2023 5:35 PM, Arne Vajhøj wrote:
> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>> Consider the case where the numbers represent money.
>>
>> Who cares what the numbers represent? For example, if you round to
>> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
>> but one rounds to 1, and the other to 2, so the lame test says that
>> they're "unequal". And 1.50001 and 2.49999 differ by 0.99998, but they
>> both round to 2, so the lame test says that they're "equal". Any test
>> which treats a difference of 0.00002 as significant, and a difference of
>> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
>> of what the numbers might represent.
>
> There are some specific rules for money usually about
> always rounding 2 digits.
>
> 1494 dollars divided by 1000 = 1.494 get rounded to 1.49
> diff 0.002 not equal
> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>
> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
> diff 0.008 equal
> 1504 dollars divided by 1000 = 1.504 get rounded to 1.50
>
> Arne
>
> PS: One should never use traditional binary based floating
> point for storing money instead use some decimal based
> type. But sometimes calculations switch to floating point
> anyway.

For maybe 45 years I've used FP (D-float) for monetary transactions and storage.
Never any problems. The secret is understanding what one is doing.

It is not always simple. Consider products with cost and prices using thousands
and even ten thousands, ie; .001 or .0001. Think of things such as golf tees,
sold by the bag, or rather large quantities. The final calculations will be
less than $.01 off, but that is acceptable. Now, sales analysis, where perhaps
millions of items are considered, can get off a bit. Usually acceptable. But,
rounding will cause some small discrepancies.

Yes, I can understand situations where D-float just won't do the job.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Software Q1 '23 Update

<tr4hgr$2ffm6$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26364&group=comp.os.vms#26364

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:18:09 -0500
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <tr4hgr$2ffm6$2@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me> <tr4aii$7ba$1@news.misty.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:18:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="bc31521357dd02b4d8b97df8b8273f59";
logging-data="2604742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DeFeD4pd2ryy7fIUC0Z5Hfhqpifp9wU4="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:WpqHKZkFHNogIjwgFWEg5GyAqGQ=
In-Reply-To: <tr4aii$7ba$1@news.misty.com>
 by: Dave Froble - Sun, 29 Jan 2023 01:18 UTC

On 1/28/2023 6:19 PM, Johnny Billquist wrote:
> On 2023-01-28 23:35, Arne Vajhøj wrote:
>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>> Consider the case where the numbers represent money.
>>>
>>> Who cares what the numbers represent? For example, if you round to
>>> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
>>> but one rounds to 1, and the other to 2, so the lame test says that
>>> they're "unequal". And 1.50001 and 2.49999 differ by 0.99998, but they
>>> both round to 2, so the lame test says that they're "equal". Any test
>>> which treats a difference of 0.00002 as significant, and a difference of
>>> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
>>> of what the numbers might represent.
>>
>> There are some specific rules for money usually about
>> always rounding 2 digits.
>>
>> 1494 dollars divided by 1000 = 1.494 get rounded to 1.49
>> diff 0.002 not equal
>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>>
>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>> diff 0.008 equal
>> 1504 dollars divided by 1000 = 1.504 get rounded to 1.50
>>
>> Arne
>>
>> PS: One should never use traditional binary based floating
>> point for storing money instead use some decimal based
>> type. But sometimes calculations switch to floating point
>> anyway.
>
> So by your own example, two values differing by 0.002 could be considered not
> equal, but two values differing by 0.008 could be considered equal. Don't you
> see that this leads to a very bad algorithm for comparing for approximate equal?
>
> More generally, 0.002 of difference might be considered equal or not equal
> purely based on what the actual values are. For some, they will be equal, and
> for some others not. The delta that is required for two numbers to be considered
> unequal varies based on what the actual numbers are.
>
> At least in my book, that is a clear indication that it's a very bad method.
>
> Johnny

My rule of thumb, when working with US$, is that any difference greater than
..001 is not equal.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Software Q1 '23 Update

<tr4hji$2ffm6$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26365&group=comp.os.vms#26365

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:19:35 -0500
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <tr4hji$2ffm6$3@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me> <tr4aii$7ba$1@news.misty.com>
<tr4ee9$2egm5$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:19:46 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="bc31521357dd02b4d8b97df8b8273f59";
logging-data="2604742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZvYfVI905HovTdYpgf9gMcZ0rkatzbuU="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:LfVqsji2mziZcZs3skSj9wkfmn4=
In-Reply-To: <tr4ee9$2egm5$1@dont-email.me>
 by: Dave Froble - Sun, 29 Jan 2023 01:19 UTC

On 1/28/2023 7:25 PM, Arne Vajhøj wrote:
> On 1/28/2023 6:19 PM, Johnny Billquist wrote:
>> On 2023-01-28 23:35, Arne Vajhøj wrote:
>>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>>> Consider the case where the numbers represent money.
>>>>
>>>> Who cares what the numbers represent? For example, if you round to
>>>> the nearest integer, then 1.49999 and 1.50001 differ by only 0.00002,
>>>> but one rounds to 1, and the other to 2, so the lame test says that
>>>> they're "unequal". And 1.50001 and 2.49999 differ by 0.99998, but they
>>>> both round to 2, so the lame test says that they're "equal". Any test
>>>> which treats a difference of 0.00002 as significant, and a difference of
>>>> 0.99998 as negligible, is, I claim, (obviously) a bad test, regardless
>>>> of what the numbers might represent.
>>>
>>> There are some specific rules for money usually about
>>> always rounding 2 digits.
>>>
>>> 1494 dollars divided by 1000 = 1.494 get rounded to 1.49
>>> diff 0.002 not equal
>>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>>>
>>> 1496 dollars divided by 1000 = 1.496 get rounded to 1.50
>>> diff 0.008 equal
>>> 1504 dollars divided by 1000 = 1.504 get rounded to 1.50
>
>> So by your own example, two values differing by 0.002 could be considered not
>> equal, but two values differing by 0.008 could be considered equal. Don't you
>> see that this leads to a very bad algorithm for comparing for approximate equal?
>>
>> More generally, 0.002 of difference might be considered equal or not equal
>> purely based on what the actual values are. For some, they will be equal, and
>> for some others not. The delta that is required for two numbers to be
>> considered unequal varies based on what the actual numbers are.
>>
>> At least in my book, that is a clear indication that it's a very bad method.
>
> I am not sure that I get your point.
>
> This is how rounding of money works.
>
> Software that operate on money needs to implement
> the rules.
>
> Same reason that good rounding supports different
> rounding mode: UP (round .5 up), EVEN (round .5 to
> even) etc.. Different places has different rules and
> the software need to implement those.
>
> Arne

Perhaps you mean .005 ???

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Software Q1 '23 Update

<tr4hmo$2ffm6$4@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26366&group=comp.os.vms#26366

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:21:17 -0500
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tr4hmo$2ffm6$4@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr48g2$2dm56$1@dont-email.me>
<d5f62077-c445-4f82-b8e5-7e671188a5bbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 Jan 2023 01:21:28 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="bc31521357dd02b4d8b97df8b8273f59";
logging-data="2604742"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JWzHHU/3UJV+pt6f9HV+k9PcCoBD6CLs="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:MK7DimHJuBMbdMz89mU/Z39YLMU=
In-Reply-To: <d5f62077-c445-4f82-b8e5-7e671188a5bbn@googlegroups.com>
 by: Dave Froble - Sun, 29 Jan 2023 01:21 UTC

On 1/28/2023 6:36 PM, Steven Schweda wrote:
>> But it can be difficult to determine upfront what a good value
>> for small it with absolute if one does not know the magnitude of
>> the numbers up front.
>
> The magnitude of the numbers might not matter as much as the number
> of bits in the mantissa.
>
> Everything's complicated, but a bad method (like, say, comparing
> rounded values) is still a bad method. (I claim.)
>

And you'd be 100% correct. It is the amount of the difference that matters.

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Software Q1 '23 Update

<tr4i45$80t$1@panix2.panix.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26367&group=comp.os.vms#26367

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix2.panix.com!panix2.panix.com!not-for-mail
From: klu...@panix.com (Scott Dorsey)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: 29 Jan 2023 01:28:37 -0000
Organization: Former users of Netcom shell (1989-2000)
Lines: 13
Message-ID: <tr4i45$80t$1@panix2.panix.com>
References: <tq8dgc$r4km$1@dont-email.me> <660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$ <tr4hgr$2ffm6$2@dont-email.me>
Injection-Info: reader2.panix.com; posting-host="panix2.panix.com:166.84.1.2";
logging-data="4740"; mail-complaints-to="abuse@panix.com"
 by: Scott Dorsey - Sun, 29 Jan 2023 01:28 UTC

>On 1/28/2023 6:19 PM, Johnny Billquist wrote:
>> On 2023-01-28 23:35, Arne Vajhøj wrote:
>>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>>> Consider the case where the numbers represent money.
>>>>
>>>> Who cares what the numbers represent? For example, if you round to

One of the absolute FIRST things that I was told about floating point
variables in my first programming class was to NEVER use them to represent
money.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."

Re: VMS Software Q1 '23 Update

<tr4ibv$2egm5$2@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26368&group=comp.os.vms#26368

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:32:45 -0500
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <tr4ibv$2egm5$2@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<26ed14b7-db40-49b1-bc1d-841c81c4877dn@googlegroups.com>
<tqp7bm$871q$1@dont-email.me> <tqpg77$9pjt$1@dont-email.me>
<tqpp85$badl$1@dont-email.me> <tqrm2c$o1tk$1@dont-email.me>
<tqrmpk$o1tk$2@dont-email.me> <tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me> <tr4hd3$2ffm6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:32:47 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="85c94694e2923b280908bdfbe0b5f4f1";
logging-data="2572997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sG5MeUZrvhf9s6Ssbt1ofMBjUrHIG//I="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:kbIxLiAZJpGsKUBN+v89l1wQhmM=
In-Reply-To: <tr4hd3$2ffm6$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 29 Jan 2023 01:32 UTC

On 1/28/2023 8:16 PM, Dave Froble wrote:
> On 1/28/2023 5:35 PM, Arne Vajhøj wrote:
>> PS: One should never use traditional binary based floating
>>     point for storing money instead use some decimal based
>>     type. But sometimes calculations switch to floating point
>>     anyway.
>
> For maybe 45 years I've used FP (D-float) for monetary transactions and
> storage.  Never any problems.  The secret is understanding what one is
> doing.
>
> It is not always simple.  Consider products with cost and prices using
> thousands and even ten thousands, ie; .001 or .0001.  Think of things
> such as golf tees, sold by the bag, or rather large quantities.  The
> final calculations will be less than $.01 off, but that is acceptable.
> Now, sales analysis, where perhaps millions of items are considered, can
> get off a bit.  Usually acceptable.  But, rounding will cause some small
> discrepancies.

I find it hard to see why one would bother with the risks
of using floating point if a decimal type is available.

VMS Basic has a decimal type.

So has Cobol and most of the post-1990 languages.

The C crowd are missing out.

Arne

Re: VMS Software Q1 '23 Update

<tr4id6$2egm5$3@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26369&group=comp.os.vms#26369

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:33:23 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <tr4id6$2egm5$3@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me> <tqp7bm$871q$1@dont-email.me>
<tqpg77$9pjt$1@dont-email.me> <tqpp85$badl$1@dont-email.me>
<tqrm2c$o1tk$1@dont-email.me> <tqrmpk$o1tk$2@dont-email.me>
<tqrrie$p41u$1@dont-email.me>
<092a42c6-b610-4dd8-8e94-68647c279c7bn@googlegroups.com>
<tqsar7$rhss$1@dont-email.me>
<9e3d2b85-b0b8-47c7-9f73-fda3a10c534bn@googlegroups.com>
<tqsf7p$s7a0$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com>
<tqsivt$srer$1@dont-email.me> <k3e21sF25rU1@mid.individual.net>
<tqtubd$16nj8$1@dont-email.me> <tquavs$18vru$1@dont-email.me>
<9f8f3187a0039369ecb14b934c0a399dce41fe28.camel@munted.eu>
<tquhac$19r40$1@dont-email.me> <tr162i$1q43n$3@dont-email.me>
<tr1r6f$1tk7m$3@dont-email.me>
<435dd522-c85e-4a46-9ba5-9a33c857d7ffn@googlegroups.com>
<tr3bd5$28ikb$2@dont-email.me>
<4a295979-2ac5-43f6-8017-01e6e2458304n@googlegroups.com>
<tr47v2$2dje6$1@dont-email.me> <tr4aii$7ba$1@news.misty.com>
<tr4ee9$2egm5$1@dont-email.me> <tr4hji$2ffm6$3@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:33:26 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="85c94694e2923b280908bdfbe0b5f4f1";
logging-data="2572997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/I6dvAw6fP5JumAUjGAPWvASKmE3Nigfk="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:rDC3uhUDBvGcftI4y2/N/zJOg20=
Content-Language: en-US
In-Reply-To: <tr4hji$2ffm6$3@dont-email.me>
 by: Arne Vajhøj - Sun, 29 Jan 2023 01:33 UTC

On 1/28/2023 8:19 PM, Dave Froble wrote:
> On 1/28/2023 7:25 PM, Arne Vajhøj wrote:
>> Same reason that good rounding supports different
>> rounding mode: UP (round .5 up), EVEN (round .5 to
>> even) etc.. Different places has different rules and
>> the software need to implement those.
>
> Perhaps you mean .005 ???

With 2 decimals then yes.

Arne

Re: VMS Software Q1 '23 Update

<tr4inv$2egm5$4@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26370&group=comp.os.vms#26370

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 20:39:09 -0500
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <tr4inv$2egm5$4@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$
<tr4hgr$2ffm6$2@dont-email.me> <tr4i45$80t$1@panix2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 01:39:11 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="85c94694e2923b280908bdfbe0b5f4f1";
logging-data="2572997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5+xMb6rBvuTSLhZciH3B1O3q/3UR8wug="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:tb0B/OH7ZVlWythetJy8TFrGkGI=
In-Reply-To: <tr4i45$80t$1@panix2.panix.com>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 29 Jan 2023 01:39 UTC

On 1/28/2023 8:28 PM, Scott Dorsey wrote:
>> On 1/28/2023 6:19 PM, Johnny Billquist wrote:
>>> On 2023-01-28 23:35, Arne Vajhøj wrote:
>>>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>>>> Consider the case where the numbers represent money.
>>>>>
>>>>> Who cares what the numbers represent? For example, if you round to
>
> One of the absolute FIRST things that I was told about floating point
> variables in my first programming class was to NEVER use them to represent
> money.

It is known to be problematic.

But there are 3 cases where it happens anyway:
- the developer does not care
- the language used does not have a decimal type and
integers with implied decimal is considered to
cumbersome
- decimal is actually used in general, but certain
calculations temporarily move over in floating
point (like some interest calculations)

Arne

Re: VMS Software Q1 '23 Update

<tr4pp3$2jk4s$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26371&group=comp.os.vms#26371

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: dav...@tsoft-inc.com (Dave Froble)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 22:39:05 -0500
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <tr4pp3$2jk4s$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$
<tr4hgr$2ffm6$2@dont-email.me> <tr4i45$80t$1@panix2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 29 Jan 2023 03:39:15 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="bc31521357dd02b4d8b97df8b8273f59";
logging-data="2740380"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+sRSR+kc1zsMe3G4OmoYoPdMxVETFYSuM="
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:xOFb2oLgUGDzx4eiLrlh5CJK4ME=
In-Reply-To: <tr4i45$80t$1@panix2.panix.com>
 by: Dave Froble - Sun, 29 Jan 2023 03:39 UTC

On 1/28/2023 8:28 PM, Scott Dorsey wrote:
>> On 1/28/2023 6:19 PM, Johnny Billquist wrote:
>>> On 2023-01-28 23:35, Arne Vajhøj wrote:
>>>> On 1/28/2023 3:01 PM, Steven Schweda wrote:
>>>>>> Consider the case where the numbers represent money.
>>>>>
>>>>> Who cares what the numbers represent? For example, if you round to
>
> One of the absolute FIRST things that I was told about floating point
> variables in my first programming class was to NEVER use them to represent
> money.
> --scott
>

What if you didn't have a choice?

RSTS/E V04b

Signed word integers
Strings
Single and double D-float

That's all there was ...

--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486

Re: VMS Software Q1 '23 Update

<tr4q3f$2jlld$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=26372&group=comp.os.vms#26372

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: VMS Software Q1 '23 Update
Date: Sat, 28 Jan 2023 22:44:45 -0500
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <tr4q3f$2jlld$1@dont-email.me>
References: <tq8dgc$r4km$1@dont-email.me>
<660be03d-246e-423c-a2b3-36c54d3759a4n@googlegroups.com> <tqsivt$srer$
<tr4hgr$2ffm6$2@dont-email.me> <tr4i45$80t$1@panix2.panix.com>
<tr4pp3$2jk4s$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 Jan 2023 03:44:47 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="85c94694e2923b280908bdfbe0b5f4f1";
logging-data="2741933"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX192Sa8lFFrJgc2LgwCNZ7fSsw3N1IT5MfE="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:bl/Y4a3OoNRVzGb840OedWlxfi4=
In-Reply-To: <tr4pp3$2jk4s$1@dont-email.me>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 29 Jan 2023 03:44 UTC

On 1/28/2023 10:39 PM, Dave Froble wrote:
> On 1/28/2023 8:28 PM, Scott Dorsey wrote:
>> One of the absolute FIRST things that I was told about floating point
>> variables in my first programming class was to NEVER use them to
>> represent
>> money.
>
> What if you didn't have a choice?
>
> RSTS/E V04b
>
> Signed word integers
> Strings
> Single and double D-float
>
> That's all there was ...

There is always integers and implied decimal.

Not fun though.

And one need an integer with enough bits ...

Could PDP-11 do 32 bit integers?

Arne

Pages:123456
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor