Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Computers are not intelligent. They only think they are.


devel / comp.sys.apple2.programmer / I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

SubjectAuthor
* I am working on a orca/c project and need "Learn to Program in C byJames Hall
`* Re: I am working on a orca/c project and need "Learn to Program in C byCraig Ruff
 `* Re: I am working on a orca/c project and need "Learn to Program in CJames Hall
  +* Re: I am working on a orca/c project and need "Learn to Program in Ctsma...@gmail.com
  |`* Re: I am working on a orca/c project and need "Learn to Program in CCraig Ruff
  | `* Re: I am working on a orca/c project and need "Learn to Program in CJames Hall
  |  +- Re: I am working on a orca/c project and need "Learn to Program in CCraig Ruff
  |  `* Re: I am working on a orca/c project and need "Learn to Program in Ctsma...@gmail.com
  |   `* Re: I am working on a orca/c project and need "Learn to Program in CJames Hall
  |    `* Re: I am working on a orca/c project and need "Learn to Program in C by Mike WesStephen Heumann
  |     `- Re: I am working on a orca/c project and need "Learn to Program in CJames Hall
  `- Re: I am working on a orca/c project and need "Learn to Program in C by Mike WesStephen Heumann

1
I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=236&group=comp.sys.apple2.programmer#236

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:622a:592:b0:2f9:29ff:daf5 with SMTP id c18-20020a05622a059200b002f929ffdaf5mr18034292qtb.601.1653500429100;
Wed, 25 May 2022 10:40:29 -0700 (PDT)
X-Received: by 2002:a05:6830:905:b0:60b:1d8f:e6dd with SMTP id
v5-20020a056830090500b0060b1d8fe6ddmr5316970ott.221.1653500428846; Wed, 25
May 2022 10:40:28 -0700 (PDT)
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.sys.apple2.programmer
Date: Wed, 25 May 2022 10:40:28 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=24.68.225.252; posting-account=R0hW2woAAABrcL9prPBapOEQVK_Gj0ww
NNTP-Posting-Host: 24.68.225.252
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
Subject: I am working on a orca/c project and need "Learn to Program in C by
Mike Westerfield"
From: james.hall.ottawa@gmail.com (James Hall)
Injection-Date: Wed, 25 May 2022 17:40:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1986
 by: James Hall - Wed, 25 May 2022 17:40 UTC

I am having some trouble getting a little bit of text formatting to display correctly. I was hoping some-one might have a link to "Learn to Program in C by Mike Westerfield". I think i had downloaded and then printed it out along with the Orca/C manual from Byteworks Morgue site many moons ago. I have come across the pdf on scribd.com, I have not had a lot of luck with that site. Oh, and Mac.Gui has a nice picture of the cover page! Thanks for tormenting me Mac.Gui. lol.

And that printed version is 3500kms away as well as at the bottom of the pile of my ][gs tools, locked away in storage. Someday soon i will have it all back in it's rightful place on shelves where i can reach and read it again. In the mean time! Can anyone point me in the right direction?

Thanks for taking the time to read this.

apple ][ forever.

James
ve3myz

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=237&group=comp.sys.apple2.programmer#237

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 25 May 2022 18:52:12 -0500
Newsgroups: comp.sys.apple2.programmer
Subject: Re: I am working on a orca/c project and need "Learn to Program in C by
Mike Westerfield"
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
Organization: Ruffspot
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: cruff@ruffspot.net (Craig Ruff)
Originator: cruff@ruffspot.net (Craig Ruff)
Message-ID: <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com>
Date: Wed, 25 May 2022 18:52:12 -0500
Lines: 10
X-Trace: sv3-KrX5Vi0tb6TGh2q+PBnS+IYPG7TsoNysozYt60wFxSW9Z6+7Zf8tyrDbBxPCI+St5ysR0EkbFOPh4ub!HjO6oofWJdYw4Gn4SG9mztawshYl6/vcEujgr0eRWJ/3unDHF6kWFFK16qAtykKldB24d0Qx8r1a!JAOYuvryvjH6mg==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1626
 by: Craig Ruff - Wed, 25 May 2022 23:52 UTC

In article <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>,
James Hall <james.hall.ottawa@gmail.com> wrote:
>I am having some trouble getting a little bit of text formatting to
>display correctly. I was hoping some-one might have a link to "Learn to
>Program in C by Mike Westerfield".

Perahps you can describe what you are trying to do and what isn't
working and we can provide suggestions? I've been using C for 40 years,
and as long as it isn't something Apple IIgs specific I might be able
to help.

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=238&group=comp.sys.apple2.programmer#238

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:6214:4110:b0:462:410:9cb0 with SMTP id kc16-20020a056214411000b0046204109cb0mr26242747qvb.78.1653528783223;
Wed, 25 May 2022 18:33:03 -0700 (PDT)
X-Received: by 2002:a05:6870:8193:b0:f1:97e0:3c36 with SMTP id
k19-20020a056870819300b000f197e03c36mr7367357oae.219.1653528782983; Wed, 25
May 2022 18:33:02 -0700 (PDT)
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.sys.apple2.programmer
Date: Wed, 25 May 2022 18:33:02 -0700 (PDT)
In-Reply-To: <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.68.225.252; posting-account=R0hW2woAAABrcL9prPBapOEQVK_Gj0ww
NNTP-Posting-Host: 24.68.225.252
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com> <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: james.hall.ottawa@gmail.com (James Hall)
Injection-Date: Thu, 26 May 2022 01:33:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1963
 by: James Hall - Thu, 26 May 2022 01:33 UTC

> Perahps you can describe what you are trying to do and what isn't
> working and we can provide suggestions? I've been using C for 40 years,
> and as long as it isn't something Apple IIgs specific I might be able
> to help.

Hi Craig, Thanks for the reply.

I am working on \t that i understand is TAB. I have been looking over the Orca/C code i have here and i do not see the \t being used.

This is one of the lines i am trying for format correctly in Orca/C. printf("0\t\t%.9f\t\t%.9f\n",output[0],zero);

The 9 point float is not aligning when i replace the \t\t with 8 spaces. I have also looked through my APW/C manuals and don't see \t defined there as well.

Thanks

James

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=239&group=comp.sys.apple2.programmer#239

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:620a:4589:b0:6a4:2e05:9f50 with SMTP id bp9-20020a05620a458900b006a42e059f50mr11643952qkb.747.1653582000538;
Thu, 26 May 2022 09:20:00 -0700 (PDT)
X-Received: by 2002:a05:6830:1e8c:b0:60b:14ab:5fe3 with SMTP id
n12-20020a0568301e8c00b0060b14ab5fe3mr8017971otr.277.1653582000208; Thu, 26
May 2022 09:20:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.apple2.programmer
Date: Thu, 26 May 2022 09:20:00 -0700 (PDT)
In-Reply-To: <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=66.235.24.147; posting-account=g_Ej0QoAAABqKdjAOUs2QJHHvw8312cj
NNTP-Posting-Host: 66.235.24.147
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: tsmaster@gmail.com (tsma...@gmail.com)
Injection-Date: Thu, 26 May 2022 16:20:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: tsma...@gmail.com - Thu, 26 May 2022 16:20 UTC

> This is one of the lines i am trying for format correctly in Orca/C. printf("0\t\t%.9f\t\t%.9f\n",output[0],zero);

Number formatting in C (and its offspring) has a lot going on. One thing to note is that %.9f means to print 9 digits of precision (i.e. digits after the decimal place) - if you're trying to make things line up in a table, you probably want to indicate the field width, which you could do by just %9f (no period), and if you wanted to combine them: %9.2f for a field with two digits after the decimal, taking up (at least) 9 spaces.

Perhaps you're already familiar with all of that - if so, please forgive the review.

> The 9 point float is not aligning when i replace the \t\t with 8 spaces.

If you remove the tabs and it's still not working, my guess is that something else (probably the float layout) is the problem. Can you show us the expected output and the output you're getting?

> I have also looked through my APW/C manuals and don't see \t defined there as well.

That's curious - I would expect that \t would be implemented somehow in any C implementation, though possibly inconsistently.

Another thought I have is that maybe the console is ignoring the tab character, and using spaces is what you're expected to do. It's been a long time since I've done any IIgs programming.

-Dave LeCompte

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<t6p0jt$h1b$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=240&group=comp.sys.apple2.programmer#240

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: stephen.heumann@gmail.com (Stephen Heumann)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"
Date: Thu, 26 May 2022 17:57:01 -0500
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <t6p0jt$h1b$1@dont-email.me>
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com> <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="e5263425cb328032eff6ea90dab973b1";
logging-data="17451"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX199/e7y99OjiDPagd52YJa4Owh+pASA66w="
User-Agent: Unison/2.2
Cancel-Lock: sha1:NaE3YEgypNmkL2mx+fzafdc8juQ=
 by: Stephen Heumann - Thu, 26 May 2022 22:57 UTC

On 2022-05-26 01:33:02 +0000, James Hall said:
>
> I am working on \t that i understand is TAB. I have been looking over
> the Orca/C code i have here and i do not see the \t being used.

ORCA/C does support the \t escape sequence, but the IIGS console
ignores tabs, which is why they don't appear to show up in the output.
For output to the console, you will need to just use spaces instead.
(The tabs will show up if you look at the output in something that
supports them, e.g. by redirecting output to a text file and then
opening that file in an editor.)

With regard to the Learn to Program in C book, the PDF of it is
available on Opus ][.

--
Stephen Heumann

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=241&group=comp.sys.apple2.programmer#241

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 26 May 2022 18:25:09 -0500
Newsgroups: comp.sys.apple2.programmer
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com> <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com> <48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com>
Organization: Ruffspot
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: cruff@ruffspot.net (Craig Ruff)
Originator: cruff@ruffspot.net (Craig Ruff)
Message-ID: <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
Date: Thu, 26 May 2022 18:25:09 -0500
Lines: 17
X-Trace: sv3-oi4zy8Taht3ow/8Qho7viAZwPR5/hz1rdwVHq0Nd02dwyE4bgkzbPc5yWmpk7j+ErJOsK+nOhyoGBev!GJV+JNyP5QJBPJ58+BQAEZxJQEQPqAEXv431WfNgbvmxrLno2XDicrS3glvClUfwUMgVA6XZ/cI0!eW3BQq9pf8ZI2A==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2263
 by: Craig Ruff - Thu, 26 May 2022 23:25 UTC

In article <48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com>,
tsma...@gmail.com <tsmaster@gmail.com> wrote:
>That's curious - I would expect that \t would be implemented somehow in any C implementation, though possibly
>inconsistently.

Presumably it is implemented since it is defined by the C standard.
The "\t" escape places a 0x09 byte in the string at that point.

>Another thought I have is that maybe the console is ignoring the tab character, and using spaces is what you're
>expected to do. It's been a long time since I've done any IIgs programming.

This is almost certainly the case, or there is a mismatch in what the
programmer expects the tab stops (tab width) to be vs the software that
is rendering the tabs into spaces. This is why many programming
standards now specify indentation as a specific number of spaces and
that use of tab characters is prohibited. That way everyone sees the
same representation, which you may not see when using tab characters.

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=242&group=comp.sys.apple2.programmer#242

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:ac8:5b44:0:b0:2f9:3470:678f with SMTP id n4-20020ac85b44000000b002f93470678fmr20111088qtw.287.1653632249527;
Thu, 26 May 2022 23:17:29 -0700 (PDT)
X-Received: by 2002:a05:6870:b68a:b0:f1:8001:1182 with SMTP id
cy10-20020a056870b68a00b000f180011182mr3334016oab.30.1653632249224; Thu, 26
May 2022 23:17:29 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!npeer.as286.net!npeer-ng0.as286.net!peer02.ams1!peer.ams1.xlned.com!news.xlned.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.sys.apple2.programmer
Date: Thu, 26 May 2022 23:17:29 -0700 (PDT)
In-Reply-To: <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.68.225.252; posting-account=R0hW2woAAABrcL9prPBapOEQVK_Gj0ww
NNTP-Posting-Host: 24.68.225.252
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
<48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: james.hall.ottawa@gmail.com (James Hall)
Injection-Date: Fri, 27 May 2022 06:17:29 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5132
 by: James Hall - Fri, 27 May 2022 06:17 UTC

Thank you Stephen Heumann, That statement jogs a memory.

Here's the VanillaC source.

printf("\ntype 16 point input vector\n");
scanf("%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f",&data[0],&data[1],&data[2],&data[3],&data[4],&data[5],&data[6],&data[7],&data[8],&data[9],&data[10],&data[11],&data[12],&data[13],&data[14],&data[15]);

R16SRFFT(data,output);
printf("\nresult is:\n");
printf("k,\t\tReal Part\t\tImaginary Part\n");
printf("0\t\t%.9f\t\t%.9f\n",output[0],zero);
printf("1\t\t%.9f\t\t%.9f\n",output[1],output[9]);
printf("2\t\t%.9f\t\t%.9f\n",output[2],output[10]);
printf("3\t\t%.9f\t\t%.9f\n",output[3],output[11]);
printf("4\t\t%.9f\t\t%.9f\n",output[4],output[12]);
printf("5\t\t%.9f\t\t%.9f\n",output[5],output[13]);
printf("6\t\t%.9f\t\t%.9f\n",output[6],output[14]);
printf("7\t\t%.9f\t\t%.9f\n",output[7],output[15]);
printf("8\t\t%.9f\t\t%.9f\n",output[8],zero);
printf("9\t\t%.9f\t\t%.9f\n",output[7],-output[15]);
printf("10\t\t%.9f\t\t%.9f\n",output[6],-output[14]);
printf("11\t\t%.9f\t\t%.9f\n",output[5],-output[13]);
printf("12\t\t%.9f\t\t%.9f\n",output[4],-output[12]);
printf("13\t\t%.9f\t\t%.9f\n",output[3],-output[11]);
printf("14\t\t%.9f\t\t%.9f\n",output[2],-output[9]);
printf("15\t\t%.9f\t\t%.9f\n",output[1],-output[8]);
}

Here is what i am expecting for output.
result is:
k, Real Part Imaginary Part
0 -2.749192238 0.000000000
1 1.549032927 1.325549364
2 -0.874582291 1.874609947
3 4.200131416 1.325549364
4 1.000027657 0.000000000
5 4.200131416 -1.325549364
6 -0.874582291 -1.874609947
7 1.549032927 -1.325549364
8 -2.749192238 0.000000000
9 1.549032927 1.325549364
10 -0.874582291 1.874609947
11 4.200131416 1.325549364
12 1.000027657 -0.000000000
13 4.200131416 -1.325549364
14 -0.874582291 -1.325549364
15 1.549032927 2.749192238

Here is what Orca/C gives you.
result is:
k,Real PartImaginary Part
08.00000000000000000000.0000000000000000000
11.0000000000000000000-5.0273394584655761719
20.0000000000000000000-0.0000000000000000000
31.0000000000000000000-1.4966056346893310547
40.00000000000000000000.0000000000000000000
51.0000000000000000000-0.6681787967681884766
60.00000000000000000000.0000000000000000000
70.9999999403953552246-0.1989121437072753906
80.00000000000000000000.0000000000000000000
90.99999994039535522460.1989121437072753906
100.0000000000000000000-0.0000000000000000000
111.00000000000000000000.6681787967681884766
120.0000000000000000000-0.0000000000000000000
131.00000000000000000001.4966056346893310547
140.00000000000000000005.0273394584655761719
151.0000000000000000000-0.0000000000000000000

When you replace the \t with 4 spaces for each occurrence of TAB, the - symbol on negative numbers do not line up.
When you add extra space to line the values up, any change to the input values change the output values and again things do not line up again.

My change, is to the float output from 9 to 19 decimal places. You can see in the Orca/C output the Positive Value Whole Number is where the Negative Symbol shows up when Negative Numbers are the output result. Also you can see that the decimal points do not line up.

Question: How do i line up the positive and negative first digits as well as the decimal points.

thank you all for the input.

James

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<kY6dnc1KKbsmXA3_nZ2dnUU7-a_NnZ2d@supernews.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=243&group=comp.sys.apple2.programmer#243

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 27 May 2022 07:19:07 -0500
Newsgroups: comp.sys.apple2.programmer
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com> <48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com> <a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com>
Organization: Ruffspot
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
From: cruff@ruffspot.net (Craig Ruff)
Originator: cruff@ruffspot.net (Craig Ruff)
Message-ID: <kY6dnc1KKbsmXA3_nZ2dnUU7-a_NnZ2d@supernews.com>
Date: Fri, 27 May 2022 07:19:07 -0500
Lines: 26
X-Trace: sv3-RXmmiT4tvOY/r4JYr3W7mRGzJCOIldX2bYRBeiiOC8WQqcCSC9VulOkg0C58lfUYIbTpRj8GW3eTChZ!tLx/zODulwNwqzp4yWei8NElR2wwgoH7dXXbT/jPREn2FhVWANjgG+z7UEbc+0HmqFwymO2AfY2a!gXdsrNvIquWpPA==
X-Complaints-To: www.supernews.com/docs/abuse.html
X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1912
 by: Craig Ruff - Fri, 27 May 2022 12:19 UTC

The trick is probably to specify the field width to include the width of
the column you want your numbers to fit inside including the sign, the
largest integer part the decimal point and the maximum precision for the
fraction you need and to not use tabs at all.

t.c:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv)
{ double a, b;

a = 123.456789;
b = -1.8435430;
printf("%15.6f %15.6f\n", a, b);
a = -0.6492856435;
b = 3452.3902587320;
printf("%15.6f %15.6f\n", a, b);
exit(0);
}

The output:
% ./t
123.456789 -1.843543
-0.649286 3452.390259

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=244&group=comp.sys.apple2.programmer#244

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:620a:46a1:b0:6a0:465e:ccca with SMTP id bq33-20020a05620a46a100b006a0465ecccamr28304861qkb.631.1653664739456;
Fri, 27 May 2022 08:18:59 -0700 (PDT)
X-Received: by 2002:a05:6870:348c:b0:e2:6df1:b1db with SMTP id
n12-20020a056870348c00b000e26df1b1dbmr4400460oah.33.1653664739065; Fri, 27
May 2022 08:18:59 -0700 (PDT)
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.sys.apple2.programmer
Date: Fri, 27 May 2022 08:18:58 -0700 (PDT)
In-Reply-To: <a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=66.235.22.213; posting-account=g_Ej0QoAAABqKdjAOUs2QJHHvw8312cj
NNTP-Posting-Host: 66.235.22.213
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
<48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
<a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: tsmaster@gmail.com (tsma...@gmail.com)
Injection-Date: Fri, 27 May 2022 15:18:59 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1916
 by: tsma...@gmail.com - Fri, 27 May 2022 15:18 UTC

> Question: How do i line up the positive and negative first digits as well as the decimal points.

Do you want the decimal points lined up, the first digits lined up, or the negative signs (if any) lined up? With data of different magnitudes like 0.0, 10.0, 100.0, -1000.0, you won't be able to get all three.

For me, I'd try

printf("%d %10.2f %10.2f %10.2f\n", n, real[n], imag[n], qual[n]);

and then tweak from there.

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<5b1fcf59-ef7e-4e0f-95b1-89a38307936an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=245&group=comp.sys.apple2.programmer#245

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:622a:10:b0:2f9:394a:59f9 with SMTP id x16-20020a05622a001000b002f9394a59f9mr20837260qtw.307.1653681212581;
Fri, 27 May 2022 12:53:32 -0700 (PDT)
X-Received: by 2002:a05:6870:b68a:b0:f1:8001:1182 with SMTP id
cy10-20020a056870b68a00b000f180011182mr5061212oab.30.1653681212348; Fri, 27
May 2022 12:53:32 -0700 (PDT)
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.sys.apple2.programmer
Date: Fri, 27 May 2022 12:53:32 -0700 (PDT)
In-Reply-To: <d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=24.68.225.252; posting-account=R0hW2woAAABrcL9prPBapOEQVK_Gj0ww
NNTP-Posting-Host: 24.68.225.252
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
<48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
<a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com> <d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5b1fcf59-ef7e-4e0f-95b1-89a38307936an@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: james.hall.ottawa@gmail.com (James Hall)
Injection-Date: Fri, 27 May 2022 19:53:32 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2093
 by: James Hall - Fri, 27 May 2022 19:53 UTC

Thank you again for the help! While i have not tried either of the last two solutions, yet. I promise i will try them both over the weekend. What keeps coming to mind is; to me it seems the alignment issue is being generated anytime there is a -Negative number! Is it possible to force orca/c to generate a +Positive sign in-front of all Positive Values. Would this resolve it ?

Thanks again for being there to suggest and bounce idea's off.

regards
James
ve3myz

Apple ][ forever.

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<t6s2ta$2ng$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=246&group=comp.sys.apple2.programmer#246

  copy link   Newsgroups: comp.sys.apple2.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: stephen.heumann@gmail.com (Stephen Heumann)
Newsgroups: comp.sys.apple2.programmer
Subject: Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"
Date: Fri, 27 May 2022 21:54:34 -0500
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <t6s2ta$2ng$1@dont-email.me>
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com> <0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com> <48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com> <a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com> <d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com> <5b1fcf59-ef7e-4e0f-95b1-89a38307936an@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: reader02.eternal-september.org; posting-host="bfe1d7ca36c87b64d1dcb1b7d817b004";
logging-data="2800"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iiN0vsfVmZXS0X4PcSV8/daEEKtWrfaQ="
User-Agent: Unison/2.2
Cancel-Lock: sha1:PDAHw+Ii41OjENPpcJLBxXrh1rw=
 by: Stephen Heumann - Sat, 28 May 2022 02:54 UTC

On 2022-05-27 19:53:32 +0000, James Hall said:

> What keeps coming to mind is; to me it seems the alignment issue is
> being generated anytime there is a -Negative number! Is it possible to
> force orca/c to generate a +Positive sign in-front of all Positive
> Values. Would this resolve it ?

You can force it to generate a + sign for positive numbers by including
the "+" flag in the format specification, e.g. "%+.9f". That should
cause numbers with a magnitude less than 10 to line up when printed.

If you will be dealing with a wider range of magnitudes, you will need
to figure out what part(s) of the numbers you want lined up, since they
would have different numbers of digits before the decimal point. One
possibility is to specify that the numbers should be padded with zeros
up to a certain field width, which you can do by including the "0" flag
and an explicit field width in the format specification, e.g.
"%+015.9f". (Very large numbers still won't line up if they have too
many digits before the decimal point, so you will need to pick a field
width that accommodates numbers within the range you intend to use.)

--
Stephen Heumann

Re: I am working on a orca/c project and need "Learn to Program in C by Mike Westerfield"

<088cad28-e48a-4095-86aa-dca09220a16an@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=247&group=comp.sys.apple2.programmer#247

  copy link   Newsgroups: comp.sys.apple2.programmer
X-Received: by 2002:a05:6214:258a:b0:462:4533:6b13 with SMTP id fq10-20020a056214258a00b0046245336b13mr23688798qvb.125.1653721344637;
Sat, 28 May 2022 00:02:24 -0700 (PDT)
X-Received: by 2002:a05:6830:1058:b0:60b:1e86:b9cf with SMTP id
b24-20020a056830105800b0060b1e86b9cfmr9992150otp.104.1653721344395; Sat, 28
May 2022 00:02:24 -0700 (PDT)
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.sys.apple2.programmer
Date: Sat, 28 May 2022 00:02:24 -0700 (PDT)
In-Reply-To: <t6s2ta$2ng$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=24.68.225.252; posting-account=R0hW2woAAABrcL9prPBapOEQVK_Gj0ww
NNTP-Posting-Host: 24.68.225.252
References: <b34f59d2-8c40-4326-8513-b9f0d65b978cn@googlegroups.com>
<0tWdneh9UsCxXBP_nZ2dnUU7-LGdnZ2d@supernews.com> <ab3c733d-3328-4aa9-95f3-5056a84d75bbn@googlegroups.com>
<48521c41-a6b6-4909-a514-96ef272db144n@googlegroups.com> <YuidnUhk0Z_IkQ3_nZ2dnUU7-c_NnZ2d@supernews.com>
<a57d172d-76fa-4adc-969a-32ab0494aef5n@googlegroups.com> <d9309dd2-fe31-4f20-83f6-caaa60759eb3n@googlegroups.com>
<5b1fcf59-ef7e-4e0f-95b1-89a38307936an@googlegroups.com> <t6s2ta$2ng$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <088cad28-e48a-4095-86aa-dca09220a16an@googlegroups.com>
Subject: Re: I am working on a orca/c project and need "Learn to Program in C
by Mike Westerfield"
From: james.hall.ottawa@gmail.com (James Hall)
Injection-Date: Sat, 28 May 2022 07:02:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2540
 by: James Hall - Sat, 28 May 2022 07:02 UTC

Thank Stephen, the + worked a charm. (:
And thank you again for the reminder of the orca console note. I recompiled using Prizm, that worked with the
\t. At this point, i am happy with the output, it is just to test my own mathlib against an original C program that needs 63 integers and 20 decimal points resolution.

Thank you as well to Craig, i have added the snippet to my source library and feel confident i will integrate it into some code.

Thank you tsma...@gmail.com, your snippet is what i was thinking would need to be done. Neat & Simple.

My change is "%+020.20f", with just a single extra space inserted for k, 1 ~ 9.
> You can force it to generate a + sign for positive numbers by including
> the "+" flag in the format specification, e.g. "%+.9f". That should
> cause numbers with a magnitude less than 10 to line up when printed.
> --
> Stephen Heumann

Apple ][ ForEver
James [ve3myz] 73

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor