Question on fc.float() and fc.double() #3658
Answered
by
dubzzz
JamieMason
asked this question in
Q&A
-
I'm probably misunderstanding something or doing something wrong here 😬 Can anyone spot what I'm missing? Thanks. Steps to reproduceRun the following const fc = require('fast-check');
fc.assert(
fc.property(fc.oneOf(fc.float(), fc.double()), (value) => {
return String(value).indexOf('.') !== -1
})
); Expected behaviour
Actual behaviour
|
Beta Was this translation helpful? Give feedback.
Answered by
dubzzz
Mar 6, 2023
Replies: 1 comment 1 reply
-
What we call For now, we do not provide any |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JamieMason
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What we call
float
in fast-check refers to single precision floating point, while what we calldouble
refers to double precision floating point, so both are able to generate integer values as they are part of their scope.For now, we do not provide any
decimal
allowing users to say: "I want at least N decimals".