Comments (5)
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.
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.
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.
Fair point. I've been able to change my code to work round this without patching algebrite. Thanx
from algebrite.
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)
- power precedence in printlatex
- i^5 returns -i, but should be i
- Simplification steps?
- Returning numerical values
- nroots and roots do not work for polynomials with non-integer coefficients
- Solving Boolean expressions
- Solving systems of equations
- Absolute value syntax errors
- Solving equations involving fractions
- Simplify
- GUI for user to edit/enter the equation in HTML
- Testing equivalance could be more smart, easily
- Update NPM version
- cann't simpifay apk
- the order of the powers of the polynomial is reversed HOT 1
- How to solve equations? HOT 2
- How to identify if an expression given by a human is in its simplified form HOT 4
- Is there some kind of AST ? HOT 1
- draw function is needed HOT 1
- Can't return numerical results < 1e-6. Can't substitute variables with scientific notation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from algebrite.