A tiny New Year's programming challenge
|
01-03-2015, 06:20 PM
Post: #9
|
|||
|
|||
RE: A tiny New Year's programming challenge
(01-03-2015 01:24 PM)Gilles Wrote: I first tried to handle all the exceptions (negative result etc.) but it looks like marmalade ! So I change to handle all the cases in a single way. The general idea is : Interesting approach. Just for comparison, I did it this way:
By the way: (01-03-2015 01:24 PM)Gilles Wrote: - Interger division by 7 (IDIV2 returns integer parts and remainder) Yes, that's a very handy and useful command. Some time ago I suggested such a command that returns both the integer part and the remainder for the 34s (like DIV in x86 assembly language), but it did not make it into the final firmware. ;-\ (01-03-2015 01:24 PM)Gilles Wrote: Note that there is nothing special to handle dd.mmaaaa or mm.ddaaaa format. The 50G manage this (DATE+ DDAYS TSTR) and by chance (?) 1.012015 means the same thing in the 2 formats (first january) Yes, I used this trick as well. ;-) On the other hand the 34s has a special DATE→ command that assembles year, month and day (given individually) into dd.mmyyyy or mm.ddyyyy or yyyy.mmdd, depending on the current date mode setting. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)