RosettaCodeData/Task/Jensens-Device/Julia/jensens-device.jl
2024-10-16 18:07:41 -07:00

14 lines
235 B
Julia

macro sum(i, loname, hiname, term)
return quote
lo = $loname
hi = $hiname
tmp = 0.0
for i in lo:hi
tmp += $term
end
return tmp
end
end
i = 0
@sum(i, 1, 100, 1.0 / i)