1 | 'use strict';
|
2 |
|
3 | var Fraction = require('fraction.js');
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | Fraction.prototype.type = 'Fraction';
|
9 | Fraction.prototype.isFraction = true;
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | Fraction.prototype.toJSON = function () {
|
17 | return {
|
18 | mathjs: 'Fraction',
|
19 | n: this.s * this.n,
|
20 | d: this.d
|
21 | };
|
22 | };
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | Fraction.fromJSON = function (json) {
|
31 | return new Fraction(json);
|
32 | };
|
33 |
|
34 | function factory(type, config, load, typed) {
|
35 | return Fraction;
|
36 | }
|
37 |
|
38 | exports.name = 'Fraction';
|
39 | exports.path = 'type';
|
40 | exports.factory = factory; |
\ | No newline at end of file |