[net.sources] Fix to Comet Halley program

canopus@amdahl.UUCP (Frank Dibbell) (04/11/85)

Alas, a small bug was discovered in the Halley's Comet progam which
I posted last week.  The program works fine for every year but 1986!
For 1986, it will give random results.  To fix the problem, make
the following change:

In the section titled: /* CALCULATE COMET POSITION         */

   change from:  if (Y > 1986) Z = 1984,  S = 0;
   change to  :  if (Y >= 1986) Z = 1984,  S = 0;

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

All of our systems have different attributes, and its difficult, if not
impossible, to produce a single version of a program that will run on
everyone's machine.  With this in mind, I will pass along some helpful
hints supplied to me by others, when dealing with halley.c:

1.  Some systems require the following include to define "tolower()":
    #include <ctype.h>

2.  On some systems the "tolower()" function is defined only for upper
    case.  In order to exit the halley program, then, the following
    code modification will be required:

change from:      if (c = (tolower(getchar())) != 'x')  continue;
                  else  break;


change to  :      c = getchar();
                  if (isupper(c))
                          c = tolower(c);
                  if (c != 'x' )  continue;
                  else break;


If anything anything else pops up, I'll probably put it into
net.sources.bugs where it belongs!
-- 
Frank Dibbell     (408-746-6493)                 {whatever}!amdahl!canopus
[R.A. 6h 22m 30s  Dec. -52d 36m]                 [Generic disclaimer.....]

garey@tekig.UUCP (Garey Fouts) (04/15/85)

In article <1390@amdahl.UUCP> canopus@amdahl.UUCP (Frank Dibbell) writes:
>
>All of our systems have different attributes, and its difficult, if not
>impossible, to produce a single version of a program that will run on
>everyone's machine... 

>Frank Dibbell     (408-746-6493)                 {whatever}!amdahl!canopus

This is what I really love about Punix..... so many standards! Please,
lord, give me VMS or some other adult system so we can share code.

Garey Fouts

geoff@boulder.UUCP (Geoffrey M. Clemm) (04/18/85)

In article <tekig.2569> garey@tekig.UUCP (Garey Fouts) writes:

>>All of our systems have different attributes, and its difficult, if not
>>impossible, to produce a single version of a program that will run on
>>everyone's machine... 
>
>This is what I really love about Punix..... so many standards! Please,
>lord, give me VMS or some other adult system so we can share code.
>
>Garey Fouts

Forget VMS and other such unstable constructs ...  Give me notebook paper
and number two pencils -- guaranteed portable and about the most "adult"
system you can find anywhere (although I do get arguments from some of
my friends that advocate stone tablets as being much more reliable).

Geoffrey Clemm

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (04/18/85)

> This is what I really love about Punix..... so many standards! Please,
> lord, give me VMS or some other adult system so we can share code.

Sure, everyone has a VAX.

There really is only a single established UNIX standard,
considering that /usr/group, ANSI C, and the System V Interface
Definition are in very close agreement.  The other significant
UNIX variant is 4.2BSD, for which a System V compatibility package
is freely available (VAX & Gould/SEL; other ports in progress).
At the application C source code level, there is a very high degree
of portability compared for example with trying to run VMS Fortran
code on any other system.

henry@utzoo.UUCP (Henry Spencer) (04/19/85)

> This is what I really love about Punix..... so many standards! Please,
> lord, give me VMS or some other adult system so we can share code.

Ok, you've got VMS on your VAX and OS/32 on your Perkin-Elmer.  How do
you propose to share code?  Many (most?) of the machines on the network
are physically incapable of running VMesS.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

eugene@ames.UUCP (Eugene Miya) (04/22/85)

> > This is what I really love about Punix..... so many standards! Please,
> > lord, give me VMS or some other adult system so we can share code.
> 
> Sure, everyone has a VAX.
> 
> Ok, you've got VMS on your VAX and OS/32 on your Perkin-Elmer.
>you propose to share code?  Many (most?) of the machines on the network
>are physically incapable of running VMesS.
>-- 
>				Henry Spencer @ U of Toronto Zoology

This doesn't belong here, but the day this was first posted was the first
time I ever ran Unix on an IBM mainframe.  With thanks to Gordon Moffet,
that day I ran Unix on several VAXen, a Sequent Balance 8000, a P-E 3240,
a PDP-11/70 [posting on it], a 4341, an IRIS, and a Cray [I guess I could glab
an IBM PC].  The original posting reminds me a physicist who's only
conception of computers was based on his experience with VAXen and Crays. :-)

If VMS is an adult system, I wonder about COS, OS/370 under MVT, TSS, OS/32,
RSX,RT,DOS, and all the other things I would have to know to accomplish what
I had to do last Thursday.  Perhaps we should standardize on one computer
type....?  Need we go to back assembly language? U*x has problems, but
based on consulting last Thursday, I declare Unix an adult system.

--eugene miya
  NASA Ames Research Center
  {hplabs,ihnp4,dual,hao,decwrl,allegra}!ames!aurora!eugene
  emiya@ames-vmsb.ARPA