neg_multiply
Finds x * -1, which is -x.
Category style, warn by default.
#import "Basic";
flip :: (x: int) -> int {
return x * -1;
}
main :: () {
print("%\n", flip(5));
}warning[neg_multiply]: `x * -1` is a negation
--> example.jai:4:12
|
4 | return x * -1;
| ^^^^^^
|
help: write `-x`
|
4 ~ return -x;
|
= note: `neg_multiply` is `warn` by default#import "Basic";
flip :: (x: int) -> int {
return -x;
}
main :: () {
print("%\n", flip(5));
}Signed integers and floats only, and only the literals -1 and -1.0.