I use C++ GSL library to generate random numbers now. The numbers obey a distribution, (e.g. normal or lognormal distribution). This library requires the input of expected value ${\mu}$ (i.e. mean) and std. deviation $\sigma$. I'd like sample random numbers within an interval $(a, b)$. So, when the generated numbers is out of the interval, then that number is discarded. For instance, I'd like to sample numbers having a normal distribution with $\mu$ = 5, $\sigma$ = 0.5, $a$ = 0.5, and $b$ = 10. The $\mu$ must be in the interval $(a, b)$.
The question is: someone said the input $\mu$ and $\sigma$ are not true $\mu$ and $\sigma$ of the sampled numbers, because the pdf $f(x)$ is truncated. But I think, since the input $\mu$ is within the $(a, b)$, and $(a, b)$ is wide enough, they might not be so different.
Is it a big difference between the input and true $\mu$ and $\sigma$? Is it anyway to analytically derive the true values of them?
Maybe, the true $\mu$ is $E(x) = \int_a^bxf(x)dx$? am I right?