Skip to content

Bug Fixed: tsub-ok.c#67

Open
vamirio98 wants to merge 1 commit into
DreamAndDead:masterfrom
vamirio98:bug-fix
Open

Bug Fixed: tsub-ok.c#67
vamirio98 wants to merge 1 commit into
DreamAndDead:masterfrom
vamirio98:bug-fix

Conversation

@vamirio98

Copy link
Copy Markdown

When x is negative and y = INT_MIN there is not a overflow, but the function tsub_ok() returns 0 (also see #59). So I try to fix it.

@iXanadu13

Copy link
Copy Markdown
int tsub_ok(int x,int y){
    return !(x>0&&y<0&&x-y<=0 || x<0&&y>0&&x-y>=0);
}

Maybe this is also a possible solution?

@paradox181

paradox181 commented Sep 12, 2023 via email

Copy link
Copy Markdown

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

Successfully merging this pull request may close these issues.

3 participants