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

add more missing round defines for compat/msvc.h #102

Open
markwkidd opened this issue Jan 30, 2019 · 0 comments
Open

add more missing round defines for compat/msvc.h #102

markwkidd opened this issue Jan 30, 2019 · 0 comments

Comments

@markwkidd
Copy link
Contributor

Earlier MSVCs are missing some math.h functions that other compilers have. There is already a #define for roundf in msvc.h that works around one of the missing round functions.

I thought I was going to need one or two more round functions so I drafted two additions, but it turns out I do not have a use case at the moment to test these with. For now I'm including the existing roundf define below for reference, along the two new drafts.

#define roundf(in) (in >= 0.0f ? floorf(in + 0.5f) : ceilf(in - 0.5f))
#define roundd(in) (in >= 0.0  ? floor(in + 0.5)   : ceil(in - 0.5))
#define roundl(in) (in >= 0.0  ? floor(in + 0.5)   : ceil(in - 0.5))
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