-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implicit conversion from float #154
Comments
@rlzdesenv Since this repo is not realy up to date, a quick workarroud is this: Line 870: Line 877: |
I'm having the log file loaded up with this error on lines 874 and 878. @lehnen, directly updating this might be rendered useless when an update or a new installation command is run. Can a pull request be made on this? |
I got the same issue. When it will be fixed? 2 years delay is nice. When can we expect a fix? |
The error "Deprecated: Implicit conversion from float 0.5 to int loses precision" suggests that there is an implicit conversion from a floating-point number (float) to an integer (int) in your code, which is losing precision. This usually happens when a non-integer division is being used, and the result is used as an index in an array or similar. In PHP, the division of two integers can produce a floating-point result. To resolve this issue, you should ensure that any division used as an index is explicitly converted to an integer. Here’s how you can adjust your getCode function to solve this problem: I change de the function:
To:
The intdiv() function in PHP performs an integer division, ensuring that the result is an integer. This should solve the problem of the implicit conversion from float to int that was causing the deprecation message. |
I've been getting a lot of alerts like
Implicit conversion from float 23.5 to int loses precision in /var/www/vendor/milon/barcode/src/Milon/Barcode/QRcode.php on line 878
The text was updated successfully, but these errors were encountered: