Real encode
Posted: Wed Apr 16, 2014 5:15 pm
Four decades of APL-ing and it finally occurs to me to wonder if encode takes a real left argument. Why? Listening to Prince sing "A Million Days". How long is that in years and days?
Of course the answer isn't really a fractional number of days. That's just probability blur from estimating instead of knowing exactly which years are leap years.
1e6⊤⍨0 365
2739 265
⍝ what about leap years?
1e6⊤⍨0,365+÷4
2737 310.75
⍝ and the centenaries that aren't leap years?
1e6⊤⍨0,365++/÷400 ¯100 4
2737 331.2775
Of course the answer isn't really a fractional number of days. That's just probability blur from estimating instead of knowing exactly which years are leap years.