Skip to content
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 to int when using getPrayTime() method #70

Open
DrAliRagab opened this issue Sep 23, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@DrAliRagab
Copy link

Screenshot 2023-09-23 132752

When using $arabic->getPrayTime(), I got this warning.

I think this is because these 3 lines:

$g = $g % 360 + ($g - ceil($g) + 1);

$q = $q % 360 + ($q - ceil($q) + 1);

$L = $L % 360 + ($L - ceil($L) + 1);

As php documentation says "Operands of modulo are converted to int before processing. For floating-point modulo, see fmod()"
Arithmetic Operators

We can use fmod() function
fmod

$g = fmod($g, 360) + ($g - ceil($g) + 1);

$q = fmod($q, 360) + ($q - ceil($q) + 1);

$L = fmod($L, 360) + ($L - ceil($L) + 1);
@khaled-alshamaa khaled-alshamaa added the bug Something isn't working label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants