for (var a0 = 10; a0 >= 0.5; a0--) {
}
There's room to do better:
- if we know that the number of iterations is an integer, rounding rules don't matter at all, just compare against 0
- repeating constant integer times and repeating length of list times are common operations that might benefit
- for when we can't tell if it's an integer at compile time, it might be better to round at the start of the loop instead of comparing against 0.5 on each iteration
- i am not entirely convinced that this would be faster in the general case as I believe I tried it in forkphorus a long time ago and ended up not keeping it
There's room to do better: