File tree 2 files changed +9
-20
lines changed
2 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -4826,13 +4826,13 @@ if((typeof module) !== 'undefined') {
4826
4826
r = _ . add ( r , s ) ;
4827
4827
} ) ;
4828
4828
simplified = r ;
4829
- //place back original multiplier and return
4830
- simplified = __ . Simplify . unstrip ( sym_array , simplified ) ;
4831
4829
//mult on back the multiplier we saved here
4832
4830
simplified = _ . multiply ( simplified , new Symbol ( m ) ) ;
4833
4831
if ( simplified . multiplier . equals ( - 1 ) ) {
4834
4832
simplified . distributeMultiplier ( ) ;
4835
4833
}
4834
+ //place back original multiplier and return
4835
+ simplified = __ . Simplify . unstrip ( sym_array , simplified ) ;
4836
4836
return simplified ;
4837
4837
}
4838
4838
Original file line number Diff line number Diff line change @@ -35,27 +35,16 @@ console.global = {tsDebugChannels: {notimeout: true}};
35
35
// x = nerdamer("3.535401^3.5").evaluate().text();
36
36
// console.log(x);
37
37
38
+ let text ;
38
39
let x ;
39
40
40
- const solveConversion = (
41
- currentUnit ,
42
- currentUnitValue ,
43
- targetUnit ,
44
- conversionString ,
45
- ) => {
46
- const conversion = nerdamer ( conversionString )
47
- let convertedExpression = conversion
48
- . evaluate ( { [ currentUnit ] : currentUnitValue } )
49
- . solveFor ( targetUnit )
50
- const convertedValue = convertedExpression [ 0 ] . text ( )
51
- return Number ( convertedValue )
52
- }
53
-
54
-
55
-
56
41
try {
57
- x = solveConversion ( 'x' , 10 , 'y' , 'x = 2 * y' ) ;
58
- console . log ( x ) ;
42
+ // x = nerdamer("(-sqrt(y^2)+4)^2");
43
+ x = nerdamer ( "(1-y)^2" ) ;
44
+ const y = x . simplify ( ) ;
45
+ console . log ( y . text ( ) ) ;
46
+ text = x . divide ( y ) . simplify ( ) . text ( ) ;
47
+ console . log ( text ) ;
59
48
} catch ( error ) {
60
49
console . log ( "error " + error )
61
50
}
You can’t perform that action at this time.
0 commit comments