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

Macro SECS() error for value > 32 #2

Open
mega64 opened this issue Mar 15, 2023 · 0 comments
Open

Macro SECS() error for value > 32 #2

mega64 opened this issue Mar 15, 2023 · 0 comments

Comments

@mega64
Copy link

mega64 commented Mar 15, 2023

Dla wartości powyżej 32 następuje przekroczenie zakresu domyślnego typu int w mnożeniu razy tysiąc:
#define SECS(t) (unsigned long) (t * 1000)
Doraźnie pomaga wymuszene typu np.: SECS(33UL) ale to niewygodne.
Przydało by się wymuszenie typu samego argunentu:
#define SECS(t) (unsigned long) ( (unsigned long) t * 1000)

@mega64 mega64 changed the title Makro SECS() error for value > 32 Macro SECS() error for value > 32 Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant