Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ five.mdFive() // 30056e1cab7a61d256fc8edd970d14f5
five.golden() // 1.618033988749895
```

##### Scientific
```javascript
five.atomic(); // 'Boron'
```

##### 5 goes multilingual
```javascript
five.arabic() // خمسة
Expand Down
2 changes: 2 additions & 0 deletions five.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
// returns 5*4*3*2*1 optimized at 500% normal factorial runtime;
return 120;
}

five.atomic = function() { return 'Boron'; };

five.negative = function() { return -five(); };
five.loud = function (lang) { return (lang && typeof five[lang] === 'function') ? five[lang]().toUpperCase() : five.english().toUpperCase();};
Expand Down
2 changes: 2 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ assert.equal('5', five.hex(), 'An hexadecimal five should be 5');
assert.equal('30056e1cab7a61d256fc8edd970d14f5', five.mdFive(), 'md5 checksum of "five" should be 30056e1cab7a61d256fc8edd970d14f5');
assert.equal('1.618033988749895', five.golden(), 'A golden five is Phive');

assert.equal('Boron', five.atomic(), 'An atomic five should be Boron');

assert.equal('-5', five.negative(), 'A negative five should be -5');
assert.equal('FIVE', five.loud(), 'A loud five should be FIVE');
assert.equal('IVEFAY', five.loud('piglatin'), 'A loud five in Pig Latin should be IVEFAY');
Expand Down