Questions tagged [math.js]

Math.js is an extensive math library for JavaScript and Node.js.

Math.js is an extensive math library for JavaScript and Node.js.

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.
  • Open source.
55 questions
0
votes
1 answer

Simple Regression Prediction Algorithm in JavaScript

I am trying to do a simple forecast of future profit of an organization based on the past records by using regression. I am following this link. For testing purpose, I have changed the sample data and it produced these results: My actual data will…
QWERTY
  • 2,303
  • 9
  • 44
  • 85
0
votes
2 answers

NodeJS - Loop through range as string

I'm trying to loop through a range of numbers in NodeJS, but not by using integers, by using a string. For example, I want to loop through from 000000 to 500000. Ie. 000001, 000002, all the way to 500000. When percieved as an integer, NodeJS will…
0
votes
1 answer

Customization of math.js

Hello I have added the whole library to my project with this line "">" the problem is that is a heavy library and the page takes long time to initiate. I just need two features which are math.std (standard deviation) and math.median (average) so…
Iosef
  • 37
  • 10
0
votes
0 answers

Evaluate Physics equation with missing operator in Javascript

I am trying to evaluate physics equation using math.js library which user writes in a textbox. For instance, its F=ma as there is no operator betweenma which should be like m*a to evaluate how can I add missing operator in equation if any is not…
0
votes
1 answer

Mandelbrot set program not working in JS fiddle

My script tags tags include a math library called math.js It can handle complex numbers and other advanced math functions. i = 0; z = math.complex(0, 0); c = math.complex(-0.75, -0.1); function Mandelbrot() { function Magnitude() { a =…
Liam
  • 117
  • 6
0
votes
2 answers

Math.js is not working on jsfiddle

I'm new to jsfiddle so it's probably something obvious but I cannot get the CDN for Math.js to work. Here is my html code and here is my…
Liam
  • 117
  • 6
-1
votes
2 answers

How do I limit a number, returned by a JS calcualation, to a predetermined Max value?

I have a JS calculation that returns a number. I need a Javascript function that limits that number to a max value. If the number returned by the calculation is greater than Max(a predetermined value) change the number to the Max value. I am…
-1
votes
1 answer

ReferenceError: Cannot access 'Math' before initialization

today I met a bug I have never seen before, also, there is none of relevant SO post about this. ReferenceError: Cannot access 'Math' before initialization I have tried to add IIFE but still not working. In my previous work on web dev, I never…
Weilory
  • 2,621
  • 19
  • 35
-1
votes
1 answer

Division by negative numbers

I am trying to calculate an angle in js using math js. I am experienced that when the division is between negative numbers js give me bad results. e.g. -6/-3 give me 20093 instead of 2. How can I solve this? here below you can see a portion of…
Pierpaolo Ercoli
  • 1,028
  • 2
  • 11
  • 32
-2
votes
2 answers

Why can't I Import the math.js file?

I tried to write binary search in my code but it seems that everytime I tried to run it. It shows an error message (Uncaught ReferenceError: math is not defined) eventhough I clearly wrote import math.js file. I'm pretty sure that something went…
Mazri_02
  • 25
  • 4
1 2 3
4