mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:07:44 +00:00
LibJS: Implement Number.prototype.toPrecision
As noted in the prototype comments, this implementation becomes less accurate as the precision approaches the limit of 100. For example: (3).toPrecision(100) Should result in "3." followed by 99 "0"s. However, due to the loss of accuracy in the floating point computations, we currently result in "2.9999999...".
This commit is contained in:
parent
f1eb975a7a
commit
dc984c53d8
5 changed files with 260 additions and 0 deletions
|
@ -468,6 +468,7 @@ namespace JS {
|
|||
P(toPlainMonthDay) \
|
||||
P(toPlainTime) \
|
||||
P(toPlainYearMonth) \
|
||||
P(toPrecision) \
|
||||
P(toString) \
|
||||
P(total) \
|
||||
P(toTemporalInstant) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue