Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle huge integers in OpenQASM 2 expression evaluator (backport #12140) #12401

Merged
merged 1 commit into from
May 14, 2024

Commits on May 14, 2024

  1. Handle huge integers in OpenQASM 2 expression evaluator (#12140)

    * Handle huge integers in OpenQASM 2 expression evaluator
    
    This modifies the expression evaluator to directly parse the backing
    string data of an integer token in a floating-point context, which lets
    us handle numbers that would otherwise overflow a `usize`.  It's
    possible for this to be totally valid, if, for example, the integer is a
    multiple of some very large power of two that doesn't overflow a
    double-precision float.
    
    We already needed to immediately cast the integer to a float, so this is
    just a more accurate way of doing the evaluation, and doesn't affect
    when we use integers in other contexts.
    
    * Clarify int/float split
    
    (cherry picked from commit fe69594)
    jakelishman authored and mergify[bot] committed May 14, 2024
    Configuration menu
    Copy the full SHA
    3d3bb0e View commit details
    Browse the repository at this point in the history