Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Old programmers never die, they just become managers.


devel / comp.lang.cobol / Redefining a V as two integers?

SubjectAuthor
* Redefining a V as two integers?Bruce Axtens
`* Re: Redefining a V as two integers?Bruce Axtens
 +* Re: Redefining a V as two integers?Rick Smith
 |`* Re: Redefining a V as two integers?Bruce Axtens
 | +- Re: Redefining a V as two integers?Rick Smith
 | +- Re: Redefining a V as two integers?Vincent Coen
 | `* Re: Redefining a V as two integers?Vincent Coen
 |  `- Re: Redefining a V as two integers?Bruce Axtens
 `* Re: Redefining a V as two integers?docdwarf
  `* Re: Redefining a V as two integers?Bruce Axtens
   `- Re: Redefining a V as two integers?docdwarf

1
Redefining a V as two integers?

<c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=413&group=comp.lang.cobol#413

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:ac8:6eca:0:b0:3a9:68ba:4c10 with SMTP id f10-20020ac86eca000000b003a968ba4c10mr2856273qtv.676.1673680263768; Fri, 13 Jan 2023 23:11:03 -0800 (PST)
X-Received: by 2002:ae9:f407:0:b0:705:bb1a:f722 with SMTP id y7-20020ae9f407000000b00705bb1af722mr982277qkl.204.1673680263501; Fri, 13 Jan 2023 23:11:03 -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!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.18.MISMATCH!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.cobol
Date: Fri, 13 Jan 2023 23:11:03 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=49.196.253.140; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 49.196.253.140
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
Subject: Redefining a V as two integers?
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Sat, 14 Jan 2023 07:11:03 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
X-Received-Bytes: 1414
 by: Bruce Axtens - Sat, 14 Jan 2023 07:11 UTC

Suppose I have

01 FLOATING-NUMBER PIC 9(16)V9(16).

Is it possible to redefine it as two numbers holding the left and right of decimal point values?

01 SINKING-NUMBER REDEFINES FLOATING-NUMBER.
03 LEFT-OF-DECIMAL PIC 9(16).
03 RIGHT-OF-DECIMAL PIC 9(16).

for example.

-- Bruce

Re: Redefining a V as two integers?

<f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=414&group=comp.lang.cobol#414

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:6214:1913:b0:534:6f77:4747 with SMTP id er19-20020a056214191300b005346f774747mr337284qvb.40.1673680694069;
Fri, 13 Jan 2023 23:18:14 -0800 (PST)
X-Received: by 2002:ac8:4d89:0:b0:3a8:162d:fbb9 with SMTP id
a9-20020ac84d89000000b003a8162dfbb9mr4370264qtw.101.1673680693887; Fri, 13
Jan 2023 23:18:13 -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.lang.cobol
Date: Fri, 13 Jan 2023 23:18:13 -0800 (PST)
In-Reply-To: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=49.196.253.140; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 49.196.253.140
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Sat, 14 Jan 2023 07:18:14 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1525
 by: Bruce Axtens - Sat, 14 Jan 2023 07:18 UTC

To answer myself, "Yes, but"

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FLOATER PIC 9(8)V9(8).
01 SINKER REDEFINES FLOATER.
03 LEFTOF PIC 9(8).
03 RIGHTOF PIC 9(8).
PROCEDURE DIVISION.
INITIALIZE SINKER.
MOVE 123.456789 TO FLOATER.
DISPLAY LEFTOF.
DISPLAY RIGHTOF.
STOP RUN.

00000123
45678900

Is there a better way?

Re: Redefining a V as two integers?

<c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=417&group=comp.lang.cobol#417

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:622a:6186:b0:3ae:9342:e23 with SMTP id hh6-20020a05622a618600b003ae93420e23mr914566qtb.146.1673703503169;
Sat, 14 Jan 2023 05:38:23 -0800 (PST)
X-Received: by 2002:ad4:5229:0:b0:4b4:39c:bbf3 with SMTP id
r9-20020ad45229000000b004b4039cbbf3mr5429572qvq.47.1673703502951; Sat, 14 Jan
2023 05:38:22 -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.lang.cobol
Date: Sat, 14 Jan 2023 05:38:22 -0800 (PST)
In-Reply-To: <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.180.88.86; posting-account=CcFQgQoAAAB4uPj9HOgZiRCM2Y_v-jmi
NNTP-Posting-Host: 98.180.88.86
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com> <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: rs847925@gmail.com (Rick Smith)
Injection-Date: Sat, 14 Jan 2023 13:38:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2298
 by: Rick Smith - Sat, 14 Jan 2023 13:38 UTC

On Saturday, January 14, 2023 at 2:18:14 AM UTC-5, bruce....@gmail.com wrote:
> To answer myself, "Yes, but"
>
> IDENTIFICATION DIVISION.
> PROGRAM-ID. HELLO-WORLD.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 FLOATER PIC 9(8)V9(8).
> 01 SINKER REDEFINES FLOATER.
> 03 LEFTOF PIC 9(8).
> 03 RIGHTOF PIC 9(8).
> PROCEDURE DIVISION.
> INITIALIZE SINKER.
> MOVE 123.456789 TO FLOATER.
> DISPLAY LEFTOF.
> DISPLAY RIGHTOF.
> STOP RUN.
>
> 00000123
> 45678900
>
> Is there a better way?

What you have done to separate the digits is implicit.
Clarity requires something explicit.

If clarity is better, then reference modification or UNSTRING
would by more clear.

MOVE FLOATER (1:8) TO LEFTOF
MOVE FLOATER (9:8) TO RIGHTOF

or

UNSTRING FLOATER INTO RIGHTOF LEFTOF

But, do you only want the digits or the value? To preserve
the value, a "V" should be inserted in RIGHTOF as in
V9(8). In which case, a MOVE statement would make
it clear.

MOVE FLOATER TO LEFTOF RIGHTOF

Which uses truncation to separate the number while
preserving the values of the parts.

Re: Redefining a V as two integers?

<40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=419&group=comp.lang.cobol#419

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:ac8:670c:0:b0:3a6:a5c3:fd3c with SMTP id e12-20020ac8670c000000b003a6a5c3fd3cmr1958778qtp.36.1673782667241;
Sun, 15 Jan 2023 03:37:47 -0800 (PST)
X-Received: by 2002:ac8:789:0:b0:3b6:2c52:3054 with SMTP id
l9-20020ac80789000000b003b62c523054mr104183qth.309.1673782667025; Sun, 15 Jan
2023 03:37:47 -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.lang.cobol
Date: Sun, 15 Jan 2023 03:37:46 -0800 (PST)
In-Reply-To: <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=49.196.253.140; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 49.196.253.140
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
<f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Sun, 15 Jan 2023 11:37:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1849
 by: Bruce Axtens - Sun, 15 Jan 2023 11:37 UTC

On Saturday, 14 January 2023 at 9:38:23 pm UTC+8, Rick Smith wrote:
> ...
I'm still thinking about the UNSTRING but in the interim I found INTEGER-PART and FRACTION-PART.

Clearly, I'm doing something wrong here.

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FLOATER PIC 9(8)V9(8).
01 LEFTOF PIC 9(8).
01 RIGHTOF PIC 9(8).
PROCEDURE DIVISION.
MOVE 123.456789 TO FLOATER.
MOVE FUNCTION INTEGER-PART(FLOATER) TO LEFTOF.
MOVE FUNCTION FRACTION-PART(FLOATER) TO RIGHTOF.
DISPLAY LEFTOF " . " RIGHTOF.
STOP RUN.

-->

00000123 . 00000000

Re: Redefining a V as two integers?

<0b4dcb90-b05d-466d-b66f-e5f0f3627500n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=420&group=comp.lang.cobol#420

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:ac8:45c8:0:b0:3b6:2b07:27cf with SMTP id e8-20020ac845c8000000b003b62b0727cfmr132642qto.147.1673787712354;
Sun, 15 Jan 2023 05:01:52 -0800 (PST)
X-Received: by 2002:a0c:fd28:0:b0:532:2e84:2db4 with SMTP id
i8-20020a0cfd28000000b005322e842db4mr1401468qvs.87.1673787712179; Sun, 15 Jan
2023 05:01:52 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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.lang.cobol
Date: Sun, 15 Jan 2023 05:01:51 -0800 (PST)
In-Reply-To: <40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.180.88.86; posting-account=CcFQgQoAAAB4uPj9HOgZiRCM2Y_v-jmi
NNTP-Posting-Host: 98.180.88.86
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
<f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>
<40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0b4dcb90-b05d-466d-b66f-e5f0f3627500n@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: rs847925@gmail.com (Rick Smith)
Injection-Date: Sun, 15 Jan 2023 13:01:52 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2132
 by: Rick Smith - Sun, 15 Jan 2023 13:01 UTC

On Sunday, January 15, 2023 at 6:37:48 AM UTC-5, bruce....@gmail.com wrote:
> On Saturday, 14 January 2023 at 9:38:23 pm UTC+8, Rick Smith wrote:
> > ...
> I'm still thinking about the UNSTRING but in the interim I found INTEGER-PART and FRACTION-PART.
>
> Clearly, I'm doing something wrong here.
> IDENTIFICATION DIVISION.
> PROGRAM-ID. HELLO-WORLD.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 FLOATER PIC 9(8)V9(8).
> 01 LEFTOF PIC 9(8).
> 01 RIGHTOF PIC 9(8).
> PROCEDURE DIVISION.
> MOVE 123.456789 TO FLOATER.
> MOVE FUNCTION INTEGER-PART(FLOATER) TO LEFTOF.
> MOVE FUNCTION FRACTION-PART(FLOATER) TO RIGHTOF.
> DISPLAY LEFTOF " . " RIGHTOF.
> STOP RUN.
>
> -->
>
> 00000123 . 00000000

FRACTION-PART preserves the value, you need
01 RIGHTOF PIC V9(8). *> Note the "V" in the picture

Re: Redefining a V as two integers?

<tq17qm$10s$1@reader2.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=422&group=comp.lang.cobol#422

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix1.panix.com!not-for-mail
From: docdwarf@panix.com
Newsgroups: comp.lang.cobol
Subject: Re: Redefining a V as two integers?
Date: Sun, 15 Jan 2023 15:58:15 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <tq17qm$10s$1@reader2.panix.com>
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com> <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>
Injection-Date: Sun, 15 Jan 2023 15:58:15 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="1052"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Sun, 15 Jan 2023 15:58 UTC

In article <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com>,
Bruce Axtens <bruce.axtens@gmail.com> wrote:
>To answer myself, "Yes, but"
>
>IDENTIFICATION DIVISION.
>PROGRAM-ID. HELLO-WORLD.
>DATA DIVISION.
>WORKING-STORAGE SECTION.
>01 FLOATER PIC 9(8)V9(8).
>01 SINKER REDEFINES FLOATER.
> 03 LEFTOF PIC 9(8).
> 03 RIGHTOF PIC 9(8).
>PROCEDURE DIVISION.
>INITIALIZE SINKER.
>MOVE 123.456789 TO FLOATER.
>DISPLAY LEFTOF.
>DISPLAY RIGHTOF.
>STOP RUN.
>
>00000123
>45678900
>
>Is there a better way?

This thread has been running for a few days but I'm taking it 'back to the
top' for a simple reason.

Given the responses to the answers I'm uncertain as to the nature of the
question. Please be so kind as to complete the following question:

'I have an implied-decimal numeric field defined as PIC S9(8)V9(8). What
is the best way to...?'

'Better' on a computational platform can be many things: most efficient in
speed, uses less disk/core, easiest for a 2-year programmer to maintain
during a 3:AM kerflooie... each of these might supply a different answer.

What'cha lookin'a do?

(oh... and as a matter of aesthetics you might want to change that
HELLO-WORLD to SKELPROG)

DD

Re: Redefining a V as two integers?

<1673798100@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=423&group=comp.lang.cobol#423

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Redefining a V as two integers?
Date: Sun, 15 Jan 2023 15:55:00 +0000
Organization: A noiseless patient Spider
Lines: 66
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1673798100@f1.n250.z2.fidonet.ftn>
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com> <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com> <40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="efef94168914c13a401e63b28d4f2a31";
logging-data="2516863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+D7+VKiStycGes8iBX4dv0"
Cancel-Lock: sha1:roOylUBWoB3R/PU2m6culeRVIn0=
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.82-server-1.mga8 CPU UNKNOWN)
X-Comment-To: "Bruce Axtens" <bruce.axtens@gmail.com>
X-FTN-TID: MBSE-FIDO 1.0.8.2 (Linux-x86_64)
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
X-FTN-TZUTC: 0000
X-FTN-AREA: COMP.LANG.COBOL
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 263/0 371/52 467/4 712/1321
X-FTN-PID: GED+LNX 1.1.5-b20180707
REPLY: googlegroups.com 926fb4a6
X-FTN-PATH: 250/1
X-FTN-CHRS: UTF-8 2
X-FTN-MSGID: 2:250/1@fidonet 63c422b4
X-Origin-Newsgroups: comp.lang.cobol
 by: Vincent Coen - Sun, 15 Jan 2023 15:55 UTC

Hello Bruce!

Sunday January 15 2023 11:37, Bruce Axtens wrote to All:

> On Saturday, 14 January 2023 at 9:38:23 pm UTC+8, Rick Smith wrote:
>> ...
> I'm still thinking about the UNSTRING but in the interim I found
> INTEGER-PART and FRACTION-PART.

> Clearly, I'm doing something wrong here.

> IDENTIFICATION DIVISION.
> PROGRAM-ID. HELLO-WORLD.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 FLOATER PIC 9(8)V9(8).
> 01 LEFTOF PIC 9(8).
> 01 RIGHTOF PIC 9(8).
> PROCEDURE DIVISION.
> MOVE 123.456789 TO FLOATER.
> MOVE FUNCTION INTEGER-PART(FLOATER) TO LEFTOF.
> MOVE FUNCTION FRACTION-PART(FLOATER) TO RIGHTOF.
> DISPLAY LEFTOF " . " RIGHTOF.
> STOP RUN.

> -->

> 00000123 . 00000000

I added a display after the move 123 etc as display "original = " floater.

Changed to 01 RIGHTOF PIC v9(8). Note added 'v'.
so the code now looks like :
>>source free
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FLOATER PIC 9(8)V9(8).
01 LEFTOF PIC 9(8).
01 RIGHTOF PIC v9(8).
PROCEDURE DIVISION.
MOVE 123.456789 TO FLOATER.
display "original = " floater.
MOVE FUNCTION INTEGER-PART(FLOATER) TO LEFTOF.
MOVE FUNCTION FRACTION-PART(FLOATER) TO RIGHTOF.
DISPLAY LEFTOF " . " RIGHTOF.
STOP RUN.

cobc -xj test1.cbl
original = 00000123.45678900
00000123 . 00000000

Used :
cobc (GnuCOBOL) 3.2-dev.0
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
Built Dec 16 2022 21:51:57
Packaged Dec 16 2022 21:51:10 UTC
C version "10.4.0"
On Linux Mageia v8 X64.

Vincent

Re: Redefining a V as two integers?

<1673799368@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=425&group=comp.lang.cobol#425

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Redefining a V as two integers?
Date: Sun, 15 Jan 2023 16:16:08 +0000
Organization: A noiseless patient Spider
Lines: 36
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1673799368@f1.n250.z2.fidonet.ftn>
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com> <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com> <40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: reader01.eternal-september.org; posting-host="efef94168914c13a401e63b28d4f2a31";
logging-data="2520991"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/j3O3edyNeKqczbA6FynWm"
Cancel-Lock: sha1:mZreaRavEPhteUIRqYSS0jXqhFo=
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
X-FTN-TID: MBSE-FIDO 1.0.8.2 (Linux-x86_64)
X-FTN-MSGID: 2:250/1@fidonet 63c426f2
X-FTN-SEEN-BY: 25/0 250/0 1 2 4 5 6 8 12 13 263/0 371/52 467/4 712/1321
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.82-server-1.mga8 CPU UNKNOWN)
X-FTN-CHRS: UTF-8 2
X-FTN-PID: GED+LNX 1.1.5-b20180707
X-FTN-PATH: 250/1
X-Comment-To: "Bruce Axtens" <bruce.axtens@gmail.com>
X-FTN-AREA: COMP.LANG.COBOL
X-Origin-Newsgroups: comp.lang.cobol
REPLY: googlegroups.com 926fb4a6
X-FTN-TZUTC: 0000
 by: Vincent Coen - Sun, 15 Jan 2023 16:16 UTC

Hello Bruce!

Sunday January 15 2023 11:37, Bruce Axtens wrote to All:

> On Saturday, 14 January 2023 at 9:38:23 pm UTC+8, Rick Smith wrote:
>> ...
> I'm still thinking about the UNSTRING but in the interim I found
> INTEGER-PART and FRACTION-PART.

> Clearly, I'm doing something wrong here.

> IDENTIFICATION DIVISION.
> PROGRAM-ID. HELLO-WORLD.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 FLOATER PIC 9(8)V9(8).
> 01 LEFTOF PIC 9(8).
> 01 RIGHTOF PIC 9(8).
> PROCEDURE DIVISION.
> MOVE 123.456789 TO FLOATER.
> MOVE FUNCTION INTEGER-PART(FLOATER) TO LEFTOF.
> MOVE FUNCTION FRACTION-PART(FLOATER) TO RIGHTOF.
> DISPLAY LEFTOF " . " RIGHTOF.
> STOP RUN.

> -->

> 00000123 . 00000000

GnuCobol Programmers Reference and Guide has been updated accordingly.

Vincent

Re: Redefining a V as two integers?

<0226710a-e195-4e5c-8830-d87e9f0f3f95n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=426&group=comp.lang.cobol#426

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a05:620a:29d1:b0:706:7088:1fe9 with SMTP id s17-20020a05620a29d100b0070670881fe9mr112642qkp.11.1673848834756;
Sun, 15 Jan 2023 22:00:34 -0800 (PST)
X-Received: by 2002:a05:622a:4d99:b0:3ac:3479:92 with SMTP id
ff25-20020a05622a4d9900b003ac34790092mr1822414qtb.166.1673848834483; Sun, 15
Jan 2023 22:00:34 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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.lang.cobol
Date: Sun, 15 Jan 2023 22:00:34 -0800 (PST)
In-Reply-To: <tq17qm$10s$1@reader2.panix.com>
Injection-Info: google-groups.googlegroups.com; posting-host=60.231.231.174; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 60.231.231.174
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
<f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <tq17qm$10s$1@reader2.panix.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0226710a-e195-4e5c-8830-d87e9f0f3f95n@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Mon, 16 Jan 2023 06:00:34 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1786
 by: Bruce Axtens - Mon, 16 Jan 2023 06:00 UTC

On Sunday, 15 January 2023 at 11:58:17 pm UTC+8, docd...@panix.com wrote:
> In article <f8eb7b04-7406-462c...@googlegroups.com>,
> Bruce Axtens <bruce....@gmail.com> wrote:

> What'cha lookin'a do?

I wanted to split a floating point number into two integers being the left of decimal point and the right of decimal point. Even as I typed that I started to wonder: if 123.456 gets split into 123 and 456, what does the 456 actually represent? It certainly doesn't represent four hundred and fifty six.

-- Bruce

Re: Redefining a V as two integers?

<9be20754-8d5e-4bd4-8478-6ee096347bcen@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=427&group=comp.lang.cobol#427

  copy link   Newsgroups: comp.lang.cobol
X-Received: by 2002:a0c:e7c6:0:b0:534:24a6:d7b7 with SMTP id c6-20020a0ce7c6000000b0053424a6d7b7mr910617qvo.55.1673848886304;
Sun, 15 Jan 2023 22:01:26 -0800 (PST)
X-Received: by 2002:a37:68d3:0:b0:706:53b0:1fb9 with SMTP id
d202-20020a3768d3000000b0070653b01fb9mr171393qkc.637.1673848886121; Sun, 15
Jan 2023 22:01:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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.lang.cobol
Date: Sun, 15 Jan 2023 22:01:25 -0800 (PST)
In-Reply-To: <1673799368@f1.n250.z2.fidonet.ftn>
Injection-Info: google-groups.googlegroups.com; posting-host=60.231.231.174; posting-account=1W9SuAoAAAApKJ8N7QNszANYOyWIVzjG
NNTP-Posting-Host: 60.231.231.174
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com>
<f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <c809fee4-57e0-4aa8-b23f-03056da476e4n@googlegroups.com>
<40b45e25-2632-4615-98af-54975325bf12n@googlegroups.com> <1673799368@f1.n250.z2.fidonet.ftn>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9be20754-8d5e-4bd4-8478-6ee096347bcen@googlegroups.com>
Subject: Re: Redefining a V as two integers?
From: bruce.axtens@gmail.com (Bruce Axtens)
Injection-Date: Mon, 16 Jan 2023 06:01:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1536
 by: Bruce Axtens - Mon, 16 Jan 2023 06:01 UTC

On Monday, 16 January 2023 at 12:16:59 am UTC+8, Vincent Coen wrote:
> Hello Bruce!
> GnuCobol Programmers Reference and Guide has been updated accordingly. >
> Vincent

Glad to be of assistance ... I think ...

Re: Redefining a V as two integers?

<tq4ker$n1e$1@reader2.panix.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=428&group=comp.lang.cobol#428

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!.POSTED.panix1.panix.com!not-for-mail
From: docdwarf@panix.com
Newsgroups: comp.lang.cobol
Subject: Re: Redefining a V as two integers?
Date: Mon, 16 Jan 2023 22:52:11 -0000 (UTC)
Organization: Public Access Networks Corp.
Message-ID: <tq4ker$n1e$1@reader2.panix.com>
References: <c65726bb-a35f-49d4-86fc-1af996ddc6c3n@googlegroups.com> <f8eb7b04-7406-462c-919c-ff52e42805c2n@googlegroups.com> <tq17qm$10s$1@reader2.panix.com> <0226710a-e195-4e5c-8830-d87e9f0f3f95n@googlegroups.com>
Injection-Date: Mon, 16 Jan 2023 22:52:11 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="panix1.panix.com:166.84.1.1";
logging-data="23598"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
 by: docdwarf@panix.com - Mon, 16 Jan 2023 22:52 UTC

In article <0226710a-e195-4e5c-8830-d87e9f0f3f95n@googlegroups.com>,
Bruce Axtens <bruce.axtens@gmail.com> wrote:
>On Sunday, 15 January 2023 at 11:58:17 pm UTC+8, docd...@panix.com wrote:
>> In article <f8eb7b04-7406-462c...@googlegroups.com>,
>> Bruce Axtens <bruce....@gmail.com> wrote:
>
>> What'cha lookin'a do?
>
>I wanted to split a floating point number into two integers being the
>left of decimal point and the right of decimal point. Even as I typed
>that I started to wonder: if 123.456 gets split into 123 and 456, what
>does the 456 actually represent? It certainly doesn't represent four
>hundred and fifty six.

My studies in arithmetics are ancient and of small quantity, Mr Axtens,
but I think you've hit this nail squarely head-on: 123.456 is a number (in
the sense of 'an enumerated quantity') while 'floating point' is a
representation of a number. Attempting to euqate a thing with the way it
is represented can lead to attractive confusions.

Rene Magritte came up with 'The Treachery of Images' in 1929. Maybe it's
time to revisit and ponder.

https://en.wikipedia.org/wiki/The_Treachery_of_Images#/media/File:MagrittePipe.jpg

DD

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor