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

Added static cast from double to float #3678

Merged
merged 1 commit into from
Jan 3, 2021
Merged

Conversation

sisco0
Copy link
Contributor

@sisco0 sisco0 commented Dec 25, 2020

Closes #3677
Compile warnings have been fixed, double and float types where having issues when double values were assigned to a float type vector. In this case, the solution was just using a static_cast<float>(doubleVal) construction, which would lower the double value precission in order to fill the target float space.

There is to say that there could be a data loss during this process (not anything different than before), so it should be studied if double is the desired type for the features_values vector or it should be float type.

It would be desirable to use .at() instead of [] in order to throw exceptions when incorrect array positions are consulted.

Compile warnings have been fixed
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS compiler warnings "warning C4244: '=': conversion from 'const _Ty' to '_Ty', possible loss of data"
3 participants