The BCmath extension is a small extension to do a few mathematical operations on big numbers, using the BCMath PHP library for arbitrary precision mathematics. It seems sufficient, but it could be that something more complete or faster is necessary, like full compliance with the IEEE 754r standard, or in other words fixing the abandoned ldecnumber library. This is a much bigger libary (Lua Module Documentation).

Visual inspection seems to indicate the quantity type follows the assumptions used by BCmath, but no docs have been found that this is in fact the intended behavior. It could just be a coincidence.

The intention with BCmath is to be able to do unit conversions on big numbers, not to do heavy number crunching. Thus simplicity and safe operations are more of a concern than fast operation. That is the reason for using the BC library through the PHP interface, which are not especially fast. If speed is necessary, then ledecnumber should be fixed instead.