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

OR condition is not formatted #3591

Open
tesuji opened this issue May 28, 2019 · 2 comments
Open

OR condition is not formatted #3591

tesuji opened this issue May 28, 2019 · 2 comments

Comments

@tesuji
Copy link
Contributor

tesuji commented May 28, 2019

Sample code:

fn main() {
    /* Common case: The double precision result is fine. */
    if (ui & 0x1fffffff) != 0x10000000  /* not a halfway case */
        || e == 0x7ff /* NaN */
    || (result - xy == z as f64 && result - z as f64 == xy) /* exact */
        || fegetround() != FE_TONEAREST
    /* not round-to-nearest */
    {}
}

What I expect:

fn main() {
    /* Common case: The double precision result is fine. */
    if (ui & 0x1fffffff) != 0x10000000  /* not a halfway case */
        || e == 0x7ff /* NaN */
        || (result - xy == z as f64 && result - z as f64 == xy) /* exact */
        || fegetround() != FE_TONEAREST /* not round-to-nearest */
    {
    }
}
@topecongiro
Copy link
Contributor

cc #3167.

@topecongiro topecongiro added this to the 3.0.0 milestone Jun 29, 2020
@ytmimi ytmimi added the a-binop label Jul 20, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Jul 20, 2022

I believe this has the same underlying issue as #3167. #3167 (comment) explains that we don't yet handle comments between binary operators and I believe that's what's causing the issues here.

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

No branches or pull requests

3 participants