3 ms·
The compactness of APL is indeed quite intriguing. One could also write your example in Julia by: sum(j -> j*2.0^(-j),1:n) sum(function,array) applies functio
by kwertzzz 5y ago
The compactness of APL is indeed quite intriguing. One could also write your example in Julia by:
sum(j -> j*2.0^(-j),1:n)
sum(function,array) applies function to all elements of array before the summation (without need to allocate an intermediate array).