Hi Jiefei,
I don't believe there's an issue with the RNG (Random Number Generator).
The unexpected result you're seeing is due to providing a float number to the
rnorm() function, which expects an integer. When you input a float, R coerces
it to an integer using as.integer(). This function trun
You could argue that the 'n' argument should be rounded rather than
truncated, but this form of coercion from float to integer is
common/standard (in C, for example). In any case, it's a long standing part
of R and is very unlikely to be changed ...
On Sat, Aug 17, 2024, 12:11 AM Jiefei Wang wrot