Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-36586

Use mxParser library instead of SamigoExpressionParser for calculated questions

    Details

    • 12 status:
      Resolved
    • 11 status:
      Resolved
    • Previous Issue Keys:
      SAM-3330
    • Test Plan:
      Hide

      In Samigo add a calculated question. More calculated questions should calculate correctly now.

      For example any trig method that includes sin(pi)*

      {x} or tan(pi)*{x}

      should be correct now.

      And examples should better respect order of operation like

      (

      {x}

      *1000*3.8/1200)/(1-1/(1+3.8/1200)^360)

      Show
      In Samigo add a calculated question. More calculated questions should calculate correctly now. For example any trig method that includes sin(pi)* {x} or tan(pi)*{x} should be correct now. And examples should better respect order of operation like ( {x} *1000*3.8/1200)/(1-1/(1+3.8/1200)^360)

      Description

      The Calculated Question parser has problems.

      Here is a complex formula that should come up with 866.2 but custom SamigoExpressionParser comes up with 894: 

      (185.9*1000*3.8/1200)/(1-1/(1+3.8/1200)^360)

       

      Here are some simple examples from the current tests that also seem to be incorrect:

      sin(PI) previously calculated as 1.23E-16

      tan(PI) previously calculated as -1.23E-16

      Github repo:
      https://github.com/redbito/MathParser.org-mXparser

      License is BSD 2

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  maintenanceteam Core Team
                  Reporter:
                  ottenhoff Sam Ottenhoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code