Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep getting runtime error #1

Open
Abdur-rahmaanJ opened this issue Mar 17, 2019 · 1 comment
Open

keep getting runtime error #1

Abdur-rahmaanJ opened this issue Mar 17, 2019 · 1 comment

Comments

@Abdur-rahmaanJ
Copy link

: RuntimeWarning: divide by zero encountered in true_divide
result=front255/(255-back)
: RuntimeWarning: invalid value encountered in true_divide
result=front
255/(255-back)
: RuntimeWarning: invalid value encountered in greater
result[result>255]=255

@game-stop
Copy link

before you do front * 255 / (255-back), you need to check if back has the value 255 (you cannot divide by zero). If the value is 255, you can set the result to white (255)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants