You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The maxDecimals argument in those functions is not doing what I expect it to do. The name implies that it will generate a float with that number of decimals, but what it actually does is generating a number between 1 and n and using that as a decimal. This means that if I use maxDecimals=2, all the floats I get will have .1 or .2 as the decimal value, instead of a decimal value between .00 and .99.
Note that because the floats are first generated as strings and then parsed, we also end up with some floating point errors.
This might be intended behaviour, in that case I think it should be documented.
Describe the bug
The
maxDecimals
argument in those functions is not doing what I expect it to do. The name implies that it will generate a float with that number of decimals, but what it actually does is generating a number between 1 and n and using that as a decimal. This means that if I use maxDecimals=2, all the floats I get will have .1 or .2 as the decimal value, instead of a decimal value between .00 and .99.Note that because the floats are first generated as strings and then parsed, we also end up with some floating point errors.
This might be intended behaviour, in that case I think it should be documented.
To Reproduce
Sample output from that code:
Note that the decimal part all have float rounding issues and are all basically .1 or .2
Expected behavior
I expected to get values looking this, with 2 decimals
Desktop (please complete the following information):
go version
output: go version go1.22.5 darwin/arm64Additional context
Here is a sample algorithm that behaves like I expect. This is the algorithm I've used to generate the expected values above
The text was updated successfully, but these errors were encountered: