Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-19458

Arithmetic operator precedence table incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: Documentation
    • Labels:
      None

      Description

      The table shows 1 for / and 3 for %.  The program below shows that % binds before / because the value of the "p" expression matches the "x" expression.  The "y" expression shows the result of binding / first.

      Rec := {UNSIGNED4 n, REAL8 x, REAL8 y, REAL8 p};
      Rec draw(UNSIGNED c) := TRANSFORM
        SELF.x := ((RANDOM() % 1000000) / 100000000) - 0.005;
        SELF.y := (RANDOM() % (1000000 / 100000000)) - 0.005;
        SELF.p := RANDOM() % 1000000 / 100000000 - 0.005;
        SELF.n := c;
      END;
      v := DATASET(10000, draw(COUNTER));
      t := TABLE(v, {avg_x:=AVE(GROUP,x), mn_x:=MIN(GROUP,x), mx_x:=MAX(GROUP,x),
          avg_y:=AVE(GROUP,y), mn_y:=MIN(GROUP,y), mx_y:=MAX(GROUP,y),
          avg_p:=AVE(GROUP,p), mn_p:=MIN(GROUP,p), mx_p:=MAX(GROUP,p)});
      OUTPUT(t);

       

        Attachments

          Activity

            People

            • Assignee:
              jamesdefabia Jim DeFabia
              Reporter:
              johnholt John Holt
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: