Jump to content

Determine day of week using Zeller's congruence


Recommended Posts

Neat!  :thumbup1:

 

I see a prime candidate for Coerce to Type in there; this, and removing the decrement by pulling the ENUM output before the increment could tidy up that last bit of syntax.

 

+1 -1 that's so funny... after I read your reply, I still needed some seconds to find this lame operation! +1 Kudo for the Coerce to Type operator. This situation seems to appear almost every state-machine-like VI!

 

 

...... and here's the Sakamoto method.

 

attachicon.gifdOW.png

 

A little bit afraid to say... but... the c code looks so much more readable in your example! I mean it makes me afraid because this kind of comment lends itself very easily into love-hate posts...

Link to comment
  • 5 years later...
On 5/11/2018 at 2:56 PM, mahgust said:

Hi!

zeller2.vi and zeller.vi has different results.

zeller.vi has correct one.

Check today date 11may18 it is friday.

 

Thanks!

The difference is in the second Q&R function, where version 2 converts the remainder to U16 instead of the quotient.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.