Skip to content

FunC gives different results for operator ~% #1670

@jeshecdom

Description

@jeshecdom

In the following code:

int calc(int x) {
    return ((x ~% -3) <= 0);
}

int calc3(int x, int y, int z) {
    return ((x ~% y) <= z);
}

calling calc(1) produces -1 (meaning true). But calling calc3(1,-3,0) produces 0 (meaning false).

Expected behavior

It was expected that calc(1) = calc3(1,-3,0), since calc is just a specialization of calc3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions