Git Product home page Git Product logo

Comments (4)

printfn avatar printfn commented on June 5, 2024 2

Hello, fend maintainer here! I've implemented a fix for this in v1.4.8.

from stract.

oeb25 avatar oeb25 commented on June 5, 2024

I did not look into the code, but it seems as if x%y is interpreted as (x/100)+y and not as modulo. For modulo one would need x mod y.

Note that we are using fend for evaluating everything in the calculator.

from stract.

mikkeldenker avatar mikkeldenker commented on June 5, 2024

Yea it seems that fend always treats % as a unit. They have an open issue to also support it as a module operator, but it seems that it might not be trivial to implement in their parser (printfn/fend#265).

I kinda want to label this as a bug as I agree this is not what the user expects. I don't know exactly how we should fix it though. I think we could either (in order of ascending difficulty and flexibility):

  1. Hot fix: replace all ([\d]+) *% *([\d]+) with $1 mod $2.
  2. It seems that the maintainer of fend wants this as well, so we might be able to fix it in their parser and upstream it.
  3. Write our own calculator.

from stract.

mikkeldenker avatar mikkeldenker commented on June 5, 2024

Awesome! Thanks for the heads up

from stract.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.