@mathigon/hilbert
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -450,3 +450,3 @@ 'use strict'; | ||
if (p <= 0 || p > 1) | ||
return null; | ||
return undefined; | ||
return Math.floor(Math.log(Math.random()) / Math.log(1 - p)); | ||
@@ -495,5 +495,3 @@ } | ||
} | ||
/** | ||
* Riemann-integrates a function from xMin to xMax, with an interval size dx. | ||
*/ | ||
/** Riemann-integrates fn(x) from xMin to xMax with an interval size dx. */ | ||
function integrate(fn, xMin, xMax, dx = 1) { | ||
@@ -507,8 +505,3 @@ let result = 0; | ||
Random.integrate = integrate; | ||
/** | ||
* The chi CDF function. | ||
* @param {number} chi | ||
* @param {number} deg | ||
* @returns {number} | ||
*/ | ||
/** The chi CDF function. */ | ||
function chiCDF(chi, deg) { | ||
@@ -660,3 +653,3 @@ let int = integrate(t => Math.pow(t, (deg - 2) / 2) * Math.exp(-t / 2), 0, chi); | ||
const params = t.regression(data); | ||
const fn = t.fn.bind(null, params); | ||
const fn = t.fn.bind(undefined, params); | ||
const coeff = coefficient(data, fn); | ||
@@ -667,3 +660,3 @@ if (coeff > threshold) | ||
} | ||
return { type: null, fn: () => { }, params: [], coeff: null }; | ||
return { type: undefined, fn: () => { }, params: [], coeff: undefined }; | ||
} | ||
@@ -1060,3 +1053,3 @@ Regression.find = find; | ||
if (!buffer || !type) | ||
return null; | ||
return undefined; | ||
if (type === TokenType.SPACE && buffer.length > 1) | ||
@@ -1197,3 +1190,3 @@ return new ExprSpace(); | ||
const lastOpen = last(stack).length ? last(stack)[0].o : | ||
null; | ||
undefined; | ||
if (isOperator(t, ') ] }') || (isOperator(t, '|') && lastOpen === '|')) { | ||
@@ -1200,0 +1193,0 @@ if (!isOperator(t, BRACKETS[lastOpen])) |
{ | ||
"name": "@mathigon/hilbert", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "JavaScript expression parsing, MathML rendering and CAS.", | ||
@@ -27,4 +27,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@mathigon/fermat": "^0.3.3", | ||
"@mathigon/core": "^0.3.3" | ||
"@mathigon/fermat": "^0.3.4", | ||
"@mathigon/core": "^0.3.4" | ||
}, | ||
@@ -31,0 +31,0 @@ "devDependencies": { |
@@ -21,3 +21,3 @@ // ============================================================================= | ||
function createToken(buffer: string, type: TokenType) { | ||
if (!buffer || !type) return null; | ||
if (!buffer || !type) return undefined; | ||
@@ -168,3 +168,3 @@ if (type === TokenType.SPACE && buffer.length > 1) return new ExprSpace(); | ||
const lastOpen = last(stack).length ? (last(stack)[0] as ExprOperator).o : | ||
null; | ||
undefined; | ||
@@ -171,0 +171,0 @@ if (isOperator(t, ') ] }') || (isOperator(t, '|') && lastOpen === '|')) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89143
2281
Updated@mathigon/core@^0.3.4
Updated@mathigon/fermat@^0.3.4