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:
2023-11-17 10:26:03 +05:30
committed by GitHub
co-authored by neeraj
parent 7c8f84b1dc
commit e54f4c9276
4 changed files with 51 additions and 1 deletions
+7
View File
@@ -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.