Skip to content

Clarification on lower bound of compute_shortest. #225

Description

@PhucXDoan

The purpose of the modified compute_shortest in the paper, if I'm not mistaken, is to find an integer within the interval (a, c) with the fewest amount of significant figures and also closest to b, all properly rounded. Whether or not a and c are included in the interval is indicated by the accept_smaller and accept_larger boolean flags respectively.

So compute_shortest(a=1123, b=1234, c=1301, accept_smaller=false, accept_larger=false) would return (12, 2) indicating 12*10^2 = 1200, which is indeed within the interval (1123, 1301) and close to 1234.

What I'm confused about is something like compute_shortest(a=1000, b=1007, c=1234, accept_smaller=false, accept_larger=false). This would give (10, 2) which maps to 1000, but the lower bound a should be excluded, right?

It's this particular sentence in the proof of the modified compute_shortest that's flying over my head, where it is stated:

A return value of b_{i} is therefore legal if and only if a_{i} != b_{i} or all_a_zero_{i} is true, ...

Why would b_{i} be legal just because all the digits truncated off of a were zeros?

Any clarifications here would be appreciated, thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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