This means that if JS's Math engine, for example, gave a result of something like 620.00000001 in the preceding math, the Math.ceil() would round this up to 621, causing an off-by-one error.
Math.round() will probably resolve this as, even with JS Math's inconsistencies, it should always round back to the correct target integer.
[In ](bitcoincash:pr0qgla00u9rq34pael3ayjf7tuqm2p3kyyrvzcsak) the following line can sometimes lead to an incorrect fee as it does a
Math.ceil
on the value.This means that if JS's Math engine, for example, gave a result of something like 620.00000001 in the preceding math, the
Math.ceil()
would round this up to 621, causing an off-by-one error.Math.round()
will probably resolve this as, even with JS Math's inconsistencies, it should always round back to the correct target integer.