Issue
I've noticed that when doing numpy addition the result is modulo.
import numpy as np
a = np.uint8(250)
b = np.uint8(10)
print(a + b) # prints 4
Is there a mathematical, computer science or functional reason behind way it is handled in this manner?
Solution
Well, the problem is the datatype uint8
you chose, which ranges only from [0..255]. You need to pick a "bigger" type, to get the correct result.
Answered By - Bastian Venthur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.