# Khan/khan-exercises

### Subversion checkout URL

You can clone with
or
.
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (55 sloc) 2.014 kB
 Subtracting decimals
randRange( 101, 999 ) randRange( 101, 999 ) randRange( 1, 3 ) randRange( 1, 3 ) A * ( B_DECIMAL > A_DECIMAL ? pow( 10, B_DECIMAL - A_DECIMAL ) : 1) B * ( A_DECIMAL > B_DECIMAL ? pow( 10, A_DECIMAL - B_DECIMAL ) : 1) (function() { var result = digits( NEW_A ); for ( var i = 0; i < ( A_DECIMAL - B_DECIMAL ) || result.length < A_DECIMAL + 1; i++ ) { result.push( 0 ); } return result; })() (function() { var result = digits( NEW_B ); for ( var i = 0; i < ( B_DECIMAL - A_DECIMAL ) || result.length < B_DECIMAL + 1; i++ ) { result.push( 0 ); } return result; })()

\Huge{roundTo( A_DECIMAL, A * pow( 10, -A_DECIMAL ) ).toFixed( A_DECIMAL ) - roundTo( B_DECIMAL, B * pow( 10, -B_DECIMAL ) ).toFixed( B_DECIMAL ) = {?}}

A * pow( 10, -A_DECIMAL ) - B * pow( 10, - B_DECIMAL )
graph.subtractor = new Subtractor( NEW_A, NEW_B, A_DIGITS, B_DIGITS ); DUMMY = Array( graph.subtractor.getNumHints() );
graph.subtractor.show(); graph.subtractor.showDecimals( A_DECIMAL, B_DECIMAL );
graph.subtractor.showHint();
Something went wrong with that request. Please try again.