Post Reply 
A tiny New Year's programming challenge
01-03-2015, 06:58 AM (This post was last modified: 01-03-2015 07:10 AM by Dieter.)
Post: #6
RE: A tiny New Year's programming challenge
(01-02-2015 10:16 PM)Gilles Wrote:  There is one error in your test cases :
01 Jan 2012 => week 52/2011, day 7

Yes, of course. #-) Sorry, just a typo.

(01-02-2015 10:16 PM)Gilles Wrote:  Here is an HP49/50 version
Work both with the flag 42 set (dd/mm/yy) or not (mm/dd/yy)

Great – thank you very much.

I have to admit I never used any kind of RPL calculator, so it's a bit difficult for me to figure out how your program works. Would you mind explaining the algorithm, please?

(01-02-2015 10:16 PM)Gilles Wrote:  Date must be entered with the current HP50g format.Ex

19.081999 IsoWk -> "1999-W33-4" (flag 42 set jj.mmaaa)
12.312012 IsoWk -> "2013-W1-1" (flag 42 not set mm.jjaaaa)

Great. If the week was returned with two digits ("2013-W01-1") the result would even be perfectly ISO-compliant.

BTW I like the way you write the date formats with j, m and a. ;-)

Dieter,
tt.mmjjjj
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: A tiny New Year's programming challenge - Dieter - 01-03-2015 06:58 AM



User(s) browsing this thread: 1 Guest(s)