On Thu, 27 Apr 2023 at 21:09, Rowan Tommins <[email protected]> wrote:
> I still don't think it justifies the "mind-blowing" and "band-aid" > hyperbole, though. It could give better errors, but the solution is still > "never initialise decimals from floats", and that would be true whatever > was built into PHP. You're right, I used hyperbole to express my point. I know that all technical decisions had the right reasons and the current implementation was made in the current way because of something. I don't want to blame what we have now. Just suggesting a new feature for a better user experience and better language future. Still, as a user: - I want to work with numbers. I don't care what is float, what is decimal internally. I will decide what I need in my case on my own. Just give me tools. - I don't want to differentiate the way of working with floats and decimals. I don't want to use classes and functions for operations that do not require them for existing scalar types. - I want to convert between floats and decimals with no issues. Because for me it is just "numbers", or "numeric values". I'm okay if I will see some warnings if I'm doing something wrong. I'm okay to lose in the performance if I'm doing conversions wrongly. - I want the language not to bother me with conversions to strings in calculations and assignments. - I want to have the best performance that is not affected by conversions to strings and back. Python has integrated libmpdec for decimals. Can PHP do the same for the native decimal support? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php
