]> git.wincent.com - hextrapolate.git/commitdiff
Add some clarifying comments
authorGreg Hurrell <greg@hurrell.net>
Fri, 2 Jun 2017 07:00:34 +0000 (00:00 -0700)
committerGreg Hurrell <greg@hurrell.net>
Fri, 2 Jun 2017 07:00:34 +0000 (00:00 -0700)
src/addDigits.js
src/convert.js
src/multiplyDigits.js

index 1d3b1a88ebe72de751df5afce6faa3171f699b90..70b713c2a75d2be037a5dac2a45323cd0eaa66da 100644 (file)
@@ -5,6 +5,10 @@
  * @flow
  */
 
+/**
+ * Adds two arrays of decimal digits, `aDigits` and `bDigits`, returning a new
+ * array of decimal digits in base `base`.
+ */
 export default function addDigits(
   aDigits: Array<number>,
   bDigits: Array<number>,
index a7f80aecd48256be193f860600a9d568dfdca0b0..6b46caa1770c26ca83243a85f0826ebcbb158877 100644 (file)
@@ -11,7 +11,8 @@ import joinDigits from './joinDigits';
 import multiplyDigits from './multiplyDigits';
 
 /**
- * Convert `number` in base `inBase`, to base `outBase`.
+ * Convert `number` in base `inBase`, to base `outBase`. Both the input `number`
+ * and return value are string representations.
  */
 export default function convert(
   number: string,
index 8925689ad796650a5aac37c86e648a70adc91cb3..011b8e2c45f94f12342b579e9429b3ad97d80da0 100644 (file)
@@ -8,7 +8,10 @@
 import addDigits from './addDigits';
 
 /**
- * Multiplication is repeated addition.
+ * Multiply an array of decimal digits, `multiplicand`, by `number`, returning
+ * the result as an array of decimal digits in base `base`.
+ *
+ * Note that multiplication is implemented as repeated addition.
  */
 export default function multiplyDigits(
   multiplicand: Array<number>,