Skip to content

math reports negative values as positive when in octal or hex, also mishandles overflow #8417

@ridiculousfish

Description

@ridiculousfish

On fish master commit 1261b53:

> math --base hex -10
0x0
> math --base hex 'pow(2, 40)'
0xffffffff

this is because the value is converted to a (presumably 32 bit) int, and then cast to an unsigned int before it is printed.

Metadata

Metadata

Labels

bugSomething that's not working as intended

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions