# Khan/khan-exercises

Added new exercise Understanding moving the decimal

• Loading branch information...
1 parent c66b0ab commit 652c8897e936a10257a346302f8025c6b9c23a8c praveenRamalingam committed with beneater Nov 23, 2011
Showing with 53 additions and 0 deletions.
1. +53 −0 exercises/understanding_moving_the_decimal.html
 @@ -0,0 +1,53 @@ + + + + + Understanding moving the decimal + + + +
+
+ randRangeNonZero( -1, 1 ) + ( PM === 1 ? "multiply" : "divide" ) + randRange( 0, 99999 ) + +
+ randRange( 1, 5 ) + randRange( 1, 5 ) +
+ + A / pow( 10, A_DECIMAL ) + A / pow( 10, B_DECIMAL ) + ( PM === 1 ? ( A_DECIMAL - B_DECIMAL ) : ( B_DECIMAL - A_DECIMAL ) ) +
+ +
+
+
+

person(1) needs to OPERATOR A_FLOAT.toFixed( A_DECIMAL ) by 10 ? times to get B_FLOAT.toFixed( B_DECIMAL )

+
+ +

POW_DIFF

+
+
+ +
+
+

Moving the decimal one position to the right is the same as person(1) multiplying the number by 10. + Moving the decimal one position to the left is the same as person(1) dividing the number by 10.

+
+ +
+

Moving the decimal right POW_DIFF is the same as multiplying the number by 10 POW_DIFF times.

+

This is the same as multiplying the number by pow( 10, POW_DIFF ):

+

{A_FLOAT.toFixed( A_DECIMAL )} * {pow( 10, POW_DIFF )} = {B_FLOAT.toFixed( B_DECIMAL )}

+
+

Moving the decimal left POW_DIFF is the same as dividing the number by 10 POW_DIFF times.

+

This is the same as dividing the number by pow( 10, POW_DIFF ):

+

{A_FLOAT.toFixed( A_DECIMAL )} / {pow( 10, POW_DIFF )} = {B_FLOAT.toFixed( B_DECIMAL )}

+
+
+
+ +

#### 0 comments on commit `652c889`

Please sign in to comment.