Cos(pi/2) does not return 0

Not intended, but hard to avoid because of floating point error. See

You can use

julia> cospi(0.5)
0.0
7 Likes