Skip to content

Adds objects of type Hex, Binary, and Octal, and gives easy conversion between all three and Decimal base.

Notifications You must be signed in to change notification settings

HermanFassett/jsDigits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jsDigits

Adds objects of type Hex, Binary, and Octal, and gives easy conversion between all three and Decimal base. No unsigned integers so far. More functions beyond add to be added.

Examples

var a = new Binary(1000).toDecimal().toString();
console.log(a); // 8
var a = new Hex("A7H");
a = a.add(new Hex([10, 0])); // new Hex has value A0H
console.log(a.toDecimal()); // 327
var a = new Hex(100);
var b = a.toBinary();
console.log(b.toString()); // 000100000000B
var a = new Hex(10);
var b = new Binary(10);
var c = new Octal(10);
var d = Number(10);
a = new Hex((a.toDecimal() + b.toDecimal() + c.toDecimal() + d).toHex());
console.log(a.toString()); // 24H

About

Adds objects of type Hex, Binary, and Octal, and gives easy conversion between all three and Decimal base.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published