mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-08 16:54:08 +00:00
Implement host API for big decimal equals (#476)
* Implement host api for big decimal equals * Add test cases for big decimal equals * Use boolean type conversion --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
This commit is contained in:
@@ -151,6 +151,13 @@ export class GraphDecimal {
|
||||
return this.value.cmp(param);
|
||||
}
|
||||
|
||||
equals (n: Decimal.Value | GraphDecimal): boolean {
|
||||
this._checkOutOfRange(this);
|
||||
const param = this._checkOutOfRange(n);
|
||||
|
||||
return this.value.equals(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to check and throw an error if a given value has exponent out of the specified range (MIN_EXP to MAX_EXP).
|
||||
* @param n A Decimal value to check the range for.
|
||||
|
||||
Reference in New Issue
Block a user