Skip to content

Commit

Permalink
Merge pull request #91 from mcpower/simpler-constructor
Browse files Browse the repository at this point in the history
Simplify Decimal constructor
  • Loading branch information
Patashu authored Jun 27, 2022
2 parents a8e3b14 + 33e5804 commit ed605a7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ export default class Decimal {
public static readonly dNumberMax = FC(1, 0, Number.MAX_VALUE);
public static readonly dNumberMin = FC(1, 0, Number.MIN_VALUE);

public sign: number = Number.NaN;
public mag: number = Number.NaN;
public layer: number = Number.NaN;
public sign = 0;
public mag = 0;
public layer = 0;

constructor(value?: DecimalSource) {
if (value instanceof Decimal) {
Expand All @@ -359,10 +359,6 @@ export default class Decimal {
this.fromNumber(value);
} else if (typeof value === "string") {
this.fromString(value);
} else {
this.sign = 0;
this.layer = 0;
this.mag = 0;
}
}

Expand Down

0 comments on commit ed605a7

Please sign in to comment.