Socket
Socket
Sign inDemoInstall

@mathigon/hilbert

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mathigon/hilbert - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

test/interval-test.ts

13

dist/hilbert.cjs.js

@@ -427,3 +427,3 @@ 'use strict';

return [0, Math.max(a[0] ** k, a[1] ** k)];
return [a[1] ** k, a[0] ** k];
return range(a[1] ** k, a[0] ** k);
}

@@ -440,5 +440,9 @@ return EMPTY; // TODO Implement this!

const interval = {
add: (a, b) => int(a[0] + b[0], a[1] + b[1]),
add: (...args) => int(core.total(args.map(a => a[0])), core.total(args.map(a => a[1]))),
sub: (a, b) => b !== undefined ? int(a[0] - b[1], a[1] - b[0]) : int(-a[1], -a[0]),
mul: (a, b) => range(a[0] * b[0], a[0] * b[1], a[1] * b[0], a[1] * b[1]),
mul: (a, ...b) => {
if (b.length > 1)
b = [interval.mul(...b)];
return range(a[0] * b[0][0], a[0] * b[0][1], a[1] * b[0][0], a[1] * b[0][1]);
},
div: (a, b) => hasZero(b) ? WHOLE : range(a[0] / b[0], a[0] / b[1], a[1] / b[0], a[1] / b[1]),

@@ -758,2 +762,5 @@ abs: (a) => {

}
interval(vars = {}) {
return this.collapse().interval(vars);
}
substitute(vars = {}) {

@@ -760,0 +767,0 @@ return this.collapse().substitute(vars);

@@ -1,3 +0,3 @@

import { words, repeat, unique, flatten, isOneOf, join, last, cache } from '@mathigon/core';
import { lcm, gcd, isBetween, nearlyEquals } from '@mathigon/fermat';
import { total, words, repeat, unique, flatten, isOneOf, join, last, cache } from '@mathigon/core';
import { isBetween, lcm, gcd, nearlyEquals } from '@mathigon/fermat';

@@ -423,3 +423,3 @@ // =============================================================================

return [0, Math.max(a[0] ** k, a[1] ** k)];
return [a[1] ** k, a[0] ** k];
return range(a[1] ** k, a[0] ** k);
}

@@ -436,5 +436,9 @@ return EMPTY; // TODO Implement this!

const interval = {
add: (a, b) => int(a[0] + b[0], a[1] + b[1]),
add: (...args) => int(total(args.map(a => a[0])), total(args.map(a => a[1]))),
sub: (a, b) => b !== undefined ? int(a[0] - b[1], a[1] - b[0]) : int(-a[1], -a[0]),
mul: (a, b) => range(a[0] * b[0], a[0] * b[1], a[1] * b[0], a[1] * b[1]),
mul: (a, ...b) => {
if (b.length > 1)
b = [interval.mul(...b)];
return range(a[0] * b[0][0], a[0] * b[0][1], a[1] * b[0][0], a[1] * b[0][1]);
},
div: (a, b) => hasZero(b) ? WHOLE : range(a[0] / b[0], a[0] / b[1], a[1] / b[0], a[1] / b[1]),

@@ -754,2 +758,5 @@ abs: (a) => {

}
interval(vars = {}) {
return this.collapse().interval(vars);
}
substitute(vars = {}) {

@@ -756,0 +763,0 @@ return this.collapse().substitute(vars);

{
"name": "@mathigon/hilbert",
"version": "0.6.4",
"version": "0.6.5",
"description": "JavaScript expression parsing, MathML rendering and CAS.",

@@ -35,13 +35,13 @@ "keywords": [

"@types/tape": "4.13.0",
"rollup": "2.46.0",
"rollup": "2.50.5",
"tape": "5.2.2",
"ts-node": "9.1.1",
"ts-node": "10.0.0",
"tslib": "2.2.0",
"typescript": "4.2.4",
"@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.22.0",
"eslint": "7.25.0",
"typescript": "4.3.2",
"@typescript-eslint/eslint-plugin": "4.26.0",
"@typescript-eslint/parser": "4.26.0",
"eslint": "7.27.0",
"eslint-config-google": "0.14.0",
"eslint-plugin-import": "2.22.1"
"eslint-plugin-import": "2.23.4"
}
}

@@ -7,2 +7,3 @@ // =============================================================================

import {total} from '@mathigon/core';
import {gcd, isBetween, lcm} from '@mathigon/fermat';

@@ -106,3 +107,3 @@ import {SpecialFunction} from './symbols';

if (hasZero(a)) return [0, Math.max(a[0] ** k, a[1] ** k)];
return [a[1] ** k, a[0] ** k];
return range(a[1] ** k, a[0] ** k);
}

@@ -124,5 +125,8 @@

export const interval: Record<Functions, (...args: Interval[]) => Interval> = {
add: (a, b) => int(a[0] + b[0], a[1] + b[1]),
add: (...args) => int(total(args.map(a => a[0])), total(args.map(a => a[1]))),
sub: (a, b) => b !== undefined ? int(a[0] - b[1], a[1] - b[0]) : int(-a[1], -a[0]),
mul: (a, b) => range(a[0] * b[0], a[0] * b[1], a[1] * b[0], a[1] * b[1]),
mul: (a, ...b) => {
if (b.length > 1) b = [interval.mul(...b)];
return range(a[0] * b[0][0], a[0] * b[0][1], a[1] * b[0][0], a[1] * b[0][1]);
},
div: (a, b) => hasZero(b)? WHOLE : range(a[0] / b[0], a[0] / b[1], a[1] / b[0], a[1] / b[1]),

@@ -129,0 +133,0 @@

@@ -249,2 +249,6 @@ // =============================================================================

interval(vars: VarMap = {}) {
return this.collapse().interval(vars);
}
substitute(vars: ExprMap = {}) {

@@ -251,0 +255,0 @@ return this.collapse().substitute(vars);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc