πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fido.ger.c_echo
Article #5

Datum

#5
From: Herbert Rosenau
Date: Wed, 10 Sep 1997 00:00
34 lines
1512 bytes
Hi Andreas,

Du meintest am 08.09.97 um 19:24 Uhr zu Guenter Wohlrab:

 AP> Bin Anfaenger!!! Das unterstrichene verstehe ich nicht!!!

GW>> int dayofweek(int y, int m, int d)               
GW>> /* (C)1993 T. Sakamoto */ {      
GW>>     static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
GW>>     y -= m < 3;

wenn m < 3, vermindere y um 1, sonst um 0.

Ausgeschrieben:

if (m < 3) y = y - 1;

Der Trick ist: Das Ergebnis eines boolschen Ausdrucks ist immer 0 (FALSE) oder
1 (TRUE).

 AP>                ^^^^
GW>>     return (y + y/3 - y/100 + y/400 + t[m-1] + d) % 7;    /* 0 =
GW>> Sunday */
 AP>                                                      ^^^^^

% ist der Operator Modulo == Divisionsrest.

Tschau/Bye

Herbert


P.S.: muοΏ½te denn das 'Re' im Subject sein?
Technical Details
Message-ID: <MSGID_2=3A2476=2F493_3416bbf5@fidonet.org>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <MSGID_2=3A244=2F1582.10_341442d9@fidonet.org>

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII
X-Google-Thread: 100a0f,a93afa2e26e20971
X-Google-Attributes: gid100a0f,public
From: Herbert.Rosenau@f493.n2476.z2.fidonet.org (Herbert Rosenau)
Subject: Datum
Date: 1997/09/10
Message-ID: <MSGID_2=3A2476=2F493_3416bbf5@fidonet.org>
X-Deja-AN: 271851706
References: <MSGID_2=3A244=2F1582.10_341442d9@fidonet.org>
X-FTN-Path: 2476/493 480 14 24/903 888 777 2480/2 13 843
X-Comment-To: (Andreas Polefka)
X-FTN-Tearline: Sqed/32 1.14/development  30:
X-FTN-Domain: Z2@fidonet
X-Gateway: FIDO .. gamma.ray.camelot.de [FIDOGATE 4.1.5]
X-FTN-Seen-By: 2490/5001 2494/28 380
Organization: Borg spreadsheet program:  Locutus 1-2-3
Newsgroups: fido.ger.c_echo