Skip to content

% should be treated as division by 100 instead of a unit. #379

@wldd22

Description

@wldd22

Currently, the percent sign is treated as a unit of its own, example:
0.5 in % -> 50%
50% in 1 -> 0.5 (1 seems to be the only number this works with, is this intended behaviour?)

Rather, it should behave as "division by 100", since that's what it means algebraically. For example:
"50%" should be equivalent to "50/100"

The unit conversion to and from % should still work. ("50% in decimal" already works, "in 1" may be unintended)

The only major genuine feature this would break (seemingly) is the ability to evaluate expressions like "50% of 6". This could be fixed by making "of" behave as multiplication, as it does normally. So:
"50% of 6" should be equivalent to "(50/100) * 6"
"5 of 4" should be equivalent to "5 * 4" (this is correct, mathematically, '5 sets of 4')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions