Sha256: b477fb5c80998751eca995081737390ce60e166f34ed5563bb0fb81c499cc61a
Contents?: true
Size: 310 Bytes
Versions: 396
Compression:
Stored size: 310 Bytes
Contents
module.exports = class Trinary BASE: 3 constructor: (decimal) -> @digits = decimal.split('').reverse().map Number toDecimal: -> out = this.digits.reduce this.accumulator, 0 if isNaN out then 0 else out accumulator: (decimal, digit, index) => decimal += digit * Math.pow @BASE, index
Version data entries
396 entries across 396 versions & 1 rubygems