4 ms·
Here's mine. No floating point logic required. let days = (i ^ (i >> 3) | 30) - 1 / (i * 9 % 17) * 2
by recursive 12y ago
Here's mine. No floating point logic required.
let days = (i ^ (i >> 3) | 30) - 1 / (i * 9 % 17) * 2
- arthurcolle 12y agoWhat language would this work in? let looks like ocaml but those don't look like the write syntactical ways to do math stuff IIRC
- tlarkworthy 12y agodoesn't work in JS:- function days2(i) { return (i ^ (i >> 3) | 30) - 1 / (i * 9 % 17) * 2 } 1 30.77777777777778 2 28 3 30.8 4 29 5 30.818181818181817 6 29.333333333333332 7 30.833333333333332 8 30.5 9 29.846153846153847 10 30.6 11 29.857142857142858 12 30.666666666666668
- recursive 12y agoThat makes sense. js doesn't have integer division.
- deleted 12y ago[deleted]