-
-
Notifications
You must be signed in to change notification settings - Fork 1
wikibase
The extension Wikibase Client use Number, which has DataValues, which may use either bcmath or floats (double) to implement numbers.
Wikibase numbers has some weirdness of its own, and some of them will have an impact on BCmath if both are used inside the same environment.
Example of stored number is "+10.01"
, which follows the same assumptions as BCmath.
Wikibase does not use infinite markers, but as BCmath does not store anything back to Wikibase that should not be a problem.
Numbers coming from Wikibase will have a max length imposed upon them, but the same restriction does not exist for BCmath. If a number is passed on through Wikibase, and the same number follows some other path, then those two numbers might not be the same. If the number is truncated, due to a string limit, then the number coming through Wikibase might be invalid. If the number is turned into a float (double) then it might have lost precision.
There are some differences in scaling, and in particular Numbers will use escalated scaling for multiplication. That will give false precision. BCmath does not use escalated scaling, and can thus give unexpected results.
Numbers implement rounding, while BCmath does not.
Numbers implement increment (bump()
), while BCmath does not.
Numbers implement decrement (slump()
), while BCmath does not.
Numbers implement left shift (shiftLeft()
), while BCmath does not.
Numbers implement right shift (shiftRight()
), while BCmath does not.