Questions tagged [mathjs]

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices.

Math JS Site

An extensive math library for JavaScript and Node.js

Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser and offers an integrated solution to work with numbers, big numbers, complex numbers, units, and matrices. Powerful and easy to use.

Features

-Supports numbers, big numbers, complex numbers, units, strings, arrays, and matrices.

-Is compatible with JavaScript’s built-in Math library.

-Contains a flexible expression parser.

-Supports chained operations.

-Comes with a large set of built-in functions and constants.

-Has no dependencies. Runs on any JavaScript engine.

-Is easily extensible

98 questions
1
vote
1 answer

Why does code-completion work on Stackblitz, but not in Intellij?

Here is a simple repository to reproduce the issue: https://github.com/tmtron/mathjs-typescript-types Stackblitz works Code completion works fine when we open the project in Stackblitz: IntelliJ does not work For some reason, code-completion in…
TmTron
  • 17,012
  • 10
  • 94
  • 142
1
vote
1 answer

Module not found running next build using yarn Plug'n'Play

I'm trying to build a Next.js project using yarn's Plug'n'Play feature. I have some pages created and I've added some packages, among them mathjs: '^10.3.0' to help me parse some user input. I'm using typescript together with eslint. Everything…
1
vote
2 answers

If there is too many 9s after a certain point do something

So basically there is an issue with math js where id it has to do this equation 1:999 or anymore nines it will crash. try { if(args == "1:999") return message.channel.send('That question is not allowed'); }…
1
vote
0 answers

webpack can't deal with non-ascii characters of mathjs extension?

I'm using webpack in my project, where I'm importing mathjs. When I try to run the generated bundle (or rather, include it in HTML), I get an unexpected token error. Here's the lines generated by webpack where the unexpected token is: try { for…
Fly
  • 810
  • 2
  • 9
  • 28
1
vote
1 answer

Requiring mathjs

I try to include the mathjs library into my project for the atan2(). When i try to include the folder that i installed using npm install @types/mathjs by var Math = require('mathjs/main/es5/index'); it throws an error that it is moved and i have to…
Meng
  • 191
  • 9
1
vote
1 answer

Javascript mathJS vector multiplication not working as expected

I'm trying to perform vector and matrix operations by using the mathJS package. I have a vector which I want to turn into a matrix by mulitplying with its transpose. The expected result would be a = [1 1 1], [1x3] vector a^T = [1 1 1]^T, [3,1]…
Frankster
  • 653
  • 7
  • 26
1
vote
2 answers

Anyway to fix mathjs vulnerabilities

In math.js there are vulnerabilities where if a person enters a impossible question, 1:999999999999999999999, it will crash the node.js process, any ideas? The code I use for calculations: let resp; try { resp =…
1
vote
1 answer

Cannot resolve 'mathjs/number'

I am using Math.js to parse and evaluate a mathematical expression, and am following the example at https://mathjs.org/docs/custom_bundling.html#numbers-only as I only need basic number support. "mathjs": "^8.1.1", is listed in my package.json…
Erich
  • 2,408
  • 18
  • 40
1
vote
0 answers

Adding / Multiplying symbolic expressions in Math.js

I'm a mathematician relatively new to javascript / Math.js, and am trying to figure out how to basic algebraic operations to a collection of functions. The setup is as below: I have three functions (the x,y,z coordinates of some parameterization in…
Steve
  • 111
  • 1
1
vote
0 answers

running simple mathjs example: “Uncaught TypeError: Cannot convert a Symbol value to a string“

I’m very new to node.js, and am just trying to learn the basics. I’m using the play.js IDE on my iPad and want to try some simple math-related javascript. I have successfully used jStat functions within the IDE, so I know that I can get it to…
richarddmorey
  • 976
  • 6
  • 19
1
vote
1 answer

Error when importing mathjs in Angular 9 CLI webworker

I am currently trying add a webworker to my Angular 9 project using Angular CLI 9.1.7. This webworker should run some calculations using mathjs 7. However, importing mathjs into the webworker always results in the following error in the browser…
dominikks
  • 21
  • 3
1
vote
1 answer

Import mathjs as a JavaScript module fails

I try to import mathjs as a module in a browser (client side). I copied this file on the server, and then try to import the JS module, but it always fails. Here are some trial I already made: import { mathjs } from "./math.min.js" SyntaxError: The…
Fifi
  • 3,360
  • 2
  • 27
  • 53
1
vote
1 answer

HTML entity(<, > and &) support in MathJax

I am facing a problem with the HTML entity inside the TEX code. I went through this link and tried all the steps from there, But still, I'm facing issues in the "&" symbol. Here is my Mathjax Configuration Object:
Kunalan Krish
  • 232
  • 1
  • 14
1
vote
1 answer

Mathjs - Declaring variables and using scopes

How can I scope variables to have expressions with other variables in the same scope? I tried this but it doesn't work. I want c to equal b + 2 then I want to be able to get the result of any variable in the scope. let scope = { a: '= b + c', …
coder
  • 11
  • 2
1
vote
2 answers

Mathjs 'The global config is read-only'?

I am using Angular 8 and math.js library for big number manipulation. I just have an updated version of math.js from 5.4.0 to 6.2.3. I am using math.js in my component in this way: import * as mathjs from 'mathjs'; constructor() { …
Milos
  • 1,678
  • 4
  • 23
  • 49