Git Product home page Git Product logo

Comments (5)

miketheanimal avatar miketheanimal commented on July 22, 2024

Follow up: I edited dist/algebrite.js and in yylog, immediately after the "isdouble" test I added:

if (isrational(p1)) {
  d = Math.log(p1.q.a / p1.q.b);
  push_double(d);
  return;
}

This fixes the problem :)

from algebrite.

miketheanimal avatar miketheanimal commented on July 22, 2024

sin(1) and cos(1) also exhibit the same problem .... same sort of isrational test in sine_of_angle and cosine_of_angle fixes these as well. Edit: and tan in yytangent

from algebrite.

davidedc avatar davidedc commented on July 22, 2024

Hi, sorry yes if that's convenient for you then great - the thinking though is that IF you enter a number as a float (with a dot) then you are OK with approximate numeric calculations coming out of it.

If you don't (say, instead of 0.1 you write 1/10 ), then the system will keep perfect symbolic results.

UNLESS you use "float" like so: float(log(2)) - then it forces the numerical approximation.

So sin(0) works because it's a perfect result.

So the system sort of works as intended, but if you want to patch it to for your use (in a branch of yours) that's great too.

from algebrite.

miketheanimal avatar miketheanimal commented on July 22, 2024

Fair point. I've been able to change my code to work round this without patching algebrite. Thanx

from algebrite.

davidedc avatar davidedc commented on July 22, 2024

No probs by the way if you do things outside of the coverage of the existing tests, or anyways if you have the impression that you are doing tricky stuff, please let's add tests to cover those things, so I make sure I don't break them!

from algebrite.

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.