Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8f7fad4

Browse files
authored
Merge branch 'main' into canonical-forms-2
2 parents3bc998d +6d7fcb1 commit8f7fad4

File tree

7 files changed

+179
-118
lines changed

7 files changed

+179
-118
lines changed

‎scripts/build.sh‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,15 @@ if [ "$BUILD" = "production" ]; then
107107
# npm run lint
108108
# echo -e $LINECLEAR$BASENAME$CHECK$DIM" Linting$RESET"
109109

110+
# Also produce a .js version, some CDN (jsdelivr) report the wrong MIME type
111+
# for .cjs files, so we need to produce a .js version
112+
cp ./dist/compute-engine.cjs ./dist/compute-engine.js
113+
cp ./dist/compute-engine.min.cjs ./dist/compute-engine.min.js
114+
cp ./dist/math-json.cjs ./dist/math-json.js
115+
cp ./dist/math-json.min.cjs ./dist/math-json.min.js
116+
110117
# Stamp the SDK version number
111-
find ./dist -type f\( -name'*.js' -o -name'*.mjs' -o -name'*.cjs'\) -exec bash -c'sedi s/{{SDK_VERSION}}/$SDK_VERSION/g {}'\;
118+
find ./dist -type f\( -name'*.js' -o -name'*.mjs' -o -name'*.cjs'-o -name'*.js'\) -exec bash -c'sedi s/{{SDK_VERSION}}/$SDK_VERSION/g {}'\;
112119
find ./dist -type f -name'*.d.ts' -exec bash -c'sedi "1s/^/\/\* $SDK_VERSION \*\/$(printf'"'"'\r'"'"')/" {}'\;
113120
find ./dist -type f -name'*.d.ts' -exec bash -c'sedi "s/{{SDK_VERSION}}/$SDK_VERSION/" {}'\;
114121

‎src/compute-engine/boxed-expression/arithmetic-mul-div.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,6 @@ export function canonicalDivide(
166166
canonicalMultiply(ce,[ce.number(c.numerator),t1]),
167167
canonicalMultiply(ce,[ce.number(c.denominator),t2]),
168168
]);
169-
170-
returncanonicalMultiply(ce,[ce.number(c),ce._fn('Divide',[t1,t2])]);
171169
}
172170
returnce._fn('Divide',[op1,op2]);
173171
}

‎src/compute-engine/boxed-expression/boxed-function.ts‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,13 @@ export class BoxedFunction extends _BoxedExpression {
476476
}
477477

478478
getisNaN():boolean|undefined{
479-
returnthis.sgn==='nan';
479+
if(!this.isNumber)returnfalse;
480+
returnundefined;// We don't know until we evaluate
480481
}
481482

482483
getisInfinity():boolean|undefined{
483-
consts=this.sgn;
484-
if(s==='positive-infinity'||s==='negative-infinity')returntrue;
485-
if(s==='complex-infinity')returntrue;
486-
returnfalse;
487-
// return this.type === 'number' && !this.isNaN;
484+
if(!this.isNumber)returnfalse;
485+
returnundefined;// We don't know until we evaluate
488486
}
489487

490488
// Not +- Infinity, not NaN

‎src/compute-engine/boxed-expression/boxed-symbol.ts‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,13 @@ export class BoxedSymbol extends _BoxedExpression {
187187
returnce.lookupSymbol(this._id)??ce.lookupFunction(this._id);
188188
}
189189

190-
/** This method returns the definition associated with the value of this symbol, or associated with
191-
* the symbol if it has no value. Used primarily to check, or obtain the value definition for, the
192-
* case where this symbol has a 'collection' definition
190+
/** This method returns the definition associated with the value of this
191+
* symbol, or associated with the symbol if it has no value. Used primarily
192+
* to check, or obtain the value definition for, the case where this symbol
193+
* has a 'collection' definition
193194
*
194-
* This is the definition to use with most operations on the symbol. Indeed, "x[2]" is accessing
195-
* the second element of **the value** of "x".
195+
* This is the definition to use with most operations on the symbol.
196+
*Indeed, "x[2]" is accessingthe second element of **the value** of "x".
196197
*/
197198
private_getDef():BoxedBaseDefinition|undefined{
198199
letdef:BoxedBaseDefinition|BoxedSymbolDefinition|undefined=
@@ -404,6 +405,7 @@ export class BoxedSymbol extends _BoxedExpression {
404405

405406
getsymbolDefinition():BoxedSymbolDefinition|undefined{
406407
if(this._def===undefined)this.bind();
408+
407409
returnthis._definstanceof_BoxedSymbolDefinition ?this._def :undefined;
408410
}
409411

@@ -621,17 +623,21 @@ export class BoxedSymbol extends _BoxedExpression {
621623
}
622624

623625
getisFinite():boolean|undefined{
626+
if(this.isNaN)returnfalse;
627+
624628
consts=this.sgn;
625629
if(!s)returnundefined;
626-
return!(infinitySgn(s)||s==='nan');
630+
return!infinitySgn(s);
627631
}
628632

629633
getisInfinity():boolean|undefined{
630634
returninfinitySgn(this.symbolDefinition?.sgn);
631635
}
632636

633637
getisNaN():boolean|undefined{
634-
returnthis.symbolDefinition?.sgn==='nan';
638+
constv=this.symbolDefinition?.value?.isNaN;
639+
if(v===undefined)returnundefined;
640+
returnv;
635641
}
636642

637643
// x > 0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp