Skip to content

Fixed RandomUtils.NextFloat() extension methods #177

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

Merged
merged 9 commits into from
May 17, 2018
Merged

Fixed RandomUtils.NextFloat() extension methods #177

merged 9 commits into from
May 17, 2018

Conversation

zeahmed
Copy link
Contributor

@zeahmed zeahmed commented May 16, 2018

Fixing #166

Removed two NextFloat() extension methods from RandomUtils and renamed NextSingle() to NextFloat()
Currently, NextFloat() is used everywhere instead of NextSingle().

Actually, for some implementation NextFloat() actually calls NextSingle() internally. Let me know if NextSingle() needs to be preserved.

/// </summary>
Single NextSingle();
Single NextFloat();
Copy link
Contributor

@TomFinley TomFinley May 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NextFloat [](start = 15, length = 9)

Hi @zeahmed thanks for the change.

I understand that it results in fewer files changed, but let's please not change IRandom. I want to get rid of the RandomUtils, but I'm less enthusiastic about making IRandom resemble it. Maybe use VS to rename this back to NextSingle.

More generally: Float (capital F) is not a concept we want to expose. Back when we had "single" and "double" precision builds, with Float type aliases in practically every file it was a concept in this codebase, but those days are long over. Now then, the RandomUtils, being a shim to facilitate that, exposed this. (Once upon a time, there was an #ifdef surrounding that block of code you've now removed, plus a few alternate codepaths.) But we should be working on removing vestigates from that time rather than having them infect "clean" innocent interfaces that had nothing to do with that. :D #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense. I will rename NextFloat() -> NextSingle().

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@TomFinley TomFinley merged commit ae1ecef into dotnet:master May 17, 2018
eerhardt pushed a commit to eerhardt/machinelearning that referenced this pull request Jul 27, 2018
Removed two NextFloat() extension methods from RandomUtils and replaced all usage of them with `IRandom.NextSingle()`.
@ghost ghost locked as resolved and limited conversation to collaborators Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants