Updated comments
This commit is contained in:
parent
3a33ffdd50
commit
259dd7d66f
1 changed files with 10 additions and 6 deletions
|
|
@ -37,14 +37,18 @@ var DEBUG = true;
|
||||||
* @property {number|null} remainder
|
* @property {number|null} remainder
|
||||||
* @property {number} error
|
* @property {number} error
|
||||||
*
|
*
|
||||||
* The 'value' property stores the 36-bit value as a two's complement integer.
|
* The 'value' property stores the 36-bit value as a signed integer, meaning if the sign bit
|
||||||
|
* (bit 35) is set, we store the corresponding negative (two's complement) value. While there
|
||||||
|
* might be some slight benefits to always storing the 36-bit value as an unsigned quantity
|
||||||
|
* and negating it "on demand", I like having JavaScript's native representation match the
|
||||||
|
* emulated value.
|
||||||
*
|
*
|
||||||
* The 'extended' property stores an additional 36 bits of data from a multiplication;
|
* The 'extended' property stores an additional 36 bits of data from a multiplication;
|
||||||
* it must also be set prior to a division. Internally, it will be set to null whenever
|
* it must also be set prior to a division. Internally, it will be set to null whenever the
|
||||||
* the current value is not extended.
|
* current value is not extended.
|
||||||
*
|
*
|
||||||
* The 'remainder' property stores the remainder from the last division. You should
|
* The 'remainder' property stores the remainder from the last division. You should assume it
|
||||||
* assume that it will be set to null by any other operation.
|
* will be set to null by any other operation.
|
||||||
*
|
*
|
||||||
* The 'error' property records any error(s) from the last operation.
|
* The 'error' property records any error(s) from the last operation.
|
||||||
*/
|
*/
|
||||||
|
|
@ -481,7 +485,7 @@ class Int36 {
|
||||||
* 126 -126 -127
|
* 126 -126 -127
|
||||||
* 127 -127 -128
|
* 127 -127 -128
|
||||||
*
|
*
|
||||||
* so you can see that, when performing two's complement, MINVAL and ZERO are not modified.
|
* you can see that, when performing two's complement, MINVAL and ZERO are not modified.
|
||||||
*
|
*
|
||||||
* However, in our happy little world, since JavaScript numbers CAN represent both positive and negative
|
* However, in our happy little world, since JavaScript numbers CAN represent both positive and negative
|
||||||
* MINVAL values, we don't need to exclude MINVAL from the conversion.
|
* MINVAL values, we don't need to exclude MINVAL from the conversion.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue