Wrong operator precedence in JavaScript?

Not reproducible Issue #16474756

Details

Author
Ralf K.
Created
Mar 20, 2018
Privacy
This issue is public.
Found in
  • Microsoft Edge
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

The following code (bit operations on integer values) deliveres different results in Edge as in Firefox or Chrome:
ip2Int = myInt | (~network) - 1;

Workaround (additional braces):
ip2Int = (myInt | (~network)) - 1

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

    • Hello,

      Thank you for providing this information about the issue. After thorough testing, we are unable to reproduce this problem in Edge with the information at hand.

      We tested with this code and always got the expected result:
      network = 200;
      myInt = 10;
      ip2Int = myInt | (~network) - 1;

      Please update this case when you can provide definitions for the variables (network
      and myInt
      ).

      Best Wishes,
      The MS Edge Team

    • Microsoft Edge Team

      Changed Status to “Not reproducible”

    You need to sign in to your Microsoft account to add a comment.

    Sign in