Avoid interim variable
Posted: Wed Nov 15, 2023 2:43 pm
Dear all,
I have the function leap, that checks if a year is a leap year or not.
Now I would like to calculate all leap years from 2023 till 2030.
leap←{0≠.=400 100 4∘|⍵}
I used this:
(leap¨y)/y←2022↓⍳2030
Could this be done simpler without saving the vector of years in y?
Thank you very much in advance.
Best regards,
Florian
I have the function leap, that checks if a year is a leap year or not.
Now I would like to calculate all leap years from 2023 till 2030.
leap←{0≠.=400 100 4∘|⍵}
I used this:
(leap¨y)/y←2022↓⍳2030
Could this be done simpler without saving the vector of years in y?
Thank you very much in advance.
Best regards,
Florian