I want to create an array of numbers from -Pi to +Pi with a step size of Pi/4. However, using linspace
does not give me the accuracy I want, I am guessing it's a problem with the data type.
arr = np.linspace(-math.pi,math.pi,math.pi/4)
print(math.cos(arr[2]))
This does not output zero but outputs an extremely small number. How do I fix the data type so that I get the output as zero?