3 ms·
Semi-related: Fortran has a where() and elsewhere() statement for applying a mask to part of an array. e.g., where (C/=0) A = B/C elsewhere
by wycy 6y ago
Semi-related: Fortran has a where() and elsewhere() statement for applying a mask to part of an array. e.g.,
where (C/=0)
A = B/C
elsewhere
A = 0.0
end
It blew my mind the first time I saw it. I’d never seen else in anything but an if statement before.
- Izkata 6y agoFeels like a good place to drop this for anyone who hasn't encountered it: python's loops have an "else" https://stackoverflow.com/questions/9979970/why-does-python-use-else-after-for-and-while-loops https://stackoverflow.com/questions/9979970/why-does-python-...