unread
Hi all!
Gina suggest out that accept the BCMath\Number class as an argument to existing functions.
This is difficult due to issues with dealing with scale, but I found that an int could be accepted.
Without strict typing, if you pass an int to an existing bc function, it will be converted to a string and then to a bc_num struct, which is obviously inefficient.
Conversion from string to bc_num is a big cost that cannot be ignored. And I'm planning on modifying the structure to make it even faster. I'm not sure if it will be ready in time for 8.4, but it will definitely have synergies with the conversion from int.
FYI, the return type is always a string, even if you pass two ints to bcadd. The return type does not change.
Regards,
Saki