Skip to content

Fast-path for rounding Real #1124

@armanbilge

Description

@armanbilge

Real.roundUp(Rational(value, SafeLong(2).pow(bits - p)))

Pointed out by @s5bug on Discord.

hmm why does it do this instead of a bitshift?
I assume it's something like 0b1.01 should round to 0b1.1, but you can just check a bit for that
instead of having to do a whole GCD

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