Skip to content

Figure out how to use magic numbers and fp #8

@danielmansson

Description

@danielmansson

In the beginning, the plan was to use decimal for magic number constants. It looks quite clean and should be deterministic as long as there is no calculations happening.

fp value = 7.21m;
or
fp result = 13.2m * value;

For this implicit cast from decimal to fp is used. Looks pretty clean. Not a huge risk for mistake since decimal is rare to use in games. Performance is not great and it will probably generate garbage.

This will not work with Burst.

Explicit casts has the same problem.

Figure something out! :)

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