[Coco] Julian Date

Wayne Campbell asa.rand at gmail.com
Tue May 23 23:37:44 EDT 2017


I was merely going by the .75 remainder in calculator. I didn't do the math
to see it is 300 and not 3.

Regardless, the Basic09 MOD function is broken as it returns 0 for the
result.


On May 23, 2017 8:32 PM, "Walter Zambotti" <zambotti at iinet.net.au> wrote:

The result of 1900 MOD 400 should always be 300 as it 100 short of the next
400 at 2000.

-----Original Message-----
From: Coco [mailto:coco-bounces at maltedmedia.com] On Behalf Of Wayne Campbell
Sent: Wednesday, 24 May 2017 11:29 AM
To: CoCoList <coco at maltedmedia.com>
Subject: Re: [Coco] Julian Date

I have the procedure working, mostly. Two problems.

1. Result shows 1.5 days more than the correct Julian day.
2. I have found a bug in the MOD function (integer version). If you type:

PRINT MOD(1900,400)

The result is 0. It should not be 0 on 1900. There should be a remainder of
3, or .75.

You can verify this by running Basic09, creating a new procedure, typing in
the above instruction, closing the editor and running the procedure. I was
shocked when I found this. I never expected it.

Wayne


On May 23, 2017 7:37 PM, "Luis Fernández" <luis46coco at hotmail.com> wrote:

> OR
>
>
> FUNCTION FechaJulDMA (tjul, dd, mm, aa) T = tjul + 62
> t2 = FIX(T / 1461) * 4 + 1700
> t1 = T MOD 1461
> IF t1 > 365 THEN
> t1 = t1 - 1
> oa = FIX(t1 / 365)
> t1 = t1 MOD 365
> END IF
> aa = t2 + oa
> dias = t1 + 1
> dd = dias
> swb = 1 - SGN(oa)
> IF dd > 212 + swb THEN dd = dd + 30
> IF dd > 59 + swb THEN dd = dd + 2 - swb mm = FIX(dd / 61) * 2 + 1 dd =
> dd MOD 61 IF dd > 31 THEN mm = mm + 1: dd = dd - 31 IF mm > 7 THEN mm
> = mm - 1 FechaJulDMA = dias END FUNCTION
>
>
>
> ------------------------------------------------------------
> ---------------------
>
> Making  CoCoDskUtil V 1.X.X, Scan magazines and organize maltedmedia
>
> http://cococoding.com/cocodskutil/ Thank Aaron Wolfe
>
> http://www.tandycoco.com<http://www.tandycoco.com/> Thank Brian Blake
>
> My personal blog: http://www.luis45ccs.blogspot.com,
>
> Excuse my English, I use google translator, my language is Spanish,
> I'm Spanish but I live in Venezuela
>
> ------------------------------------------------------------
> ---------------------
>
>
> ________________________________
> De: Coco <coco-bounces at maltedmedia.com> en nombre de phillip taylor <
> ptaylor2446 at gmail.com>
> Enviado: martes, 23 de mayo de 2017 08:38 p.m.
> Para: CoCoList for Color Computer Enthusiasts
> Asunto: Re: [Coco] Julian Date
>
> Thank you but I did not write this code I got it off the internet.
>
> On Tue, May 23, 2017 at 8:15 PM, Mark McDougall
> <msmcdoug at iinet.net.au>
> wrote:
>
> > On 24/05/2017 8:46 AM, phillip taylor wrote:
> >
> > I am not sure what you mean by this "At least those skilled in
> > BASIC09
> >> will be able to fund an early retirement! ;)" but there is nothing
> >> wrong with Basic09 or most of the other compilers that run under
> >> Rsdos or Microsoft Windows. Cbasic will compile a basic program to
> >> machine lanuage and will run 1 to 1000 faster then a program written
in Basic.
> >>
> >
> > Not sure how you took away that I was criticizing BASIC09 or any
> > other language from that statement?!?
> >
> > I was referring to the COBOL programmers that retired off the back
> > of the Y2K problem, implying that the situation would be the same in
> > 2400 (ignoring the fact that it has been pointed out that it isn't
> > actually a leap year) for BASIC09 programmers.
> >
> > Anyway, if one has to explain one's jokes then I guess they've
> > fallen flat. :( I tried...
> >
> > Regards,
> >
> > --
> > Mark McDougall
> > <http://retroports.blogspot.com.au>
> >
> > --
> > Coco mailing list
> > Coco at maltedmedia.com
> > https://pairlist5.pair.net/mailman/listinfo/coco
> >
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> https://pairlist5.pair.net/mailman/listinfo/coco
>

--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list