Truncate calculated probabilities into the range [0,1]
截断计算概率成的范围内[0,1]
用法----------Usage----------
valid(x)
参数----------Arguments----------
参数:x
probability
可能性
Details
详细信息----------Details----------
Due to floating-point arithmetic, a number that should represent a probability can be calculated as being less than zero or greater than one. This function returns a value that is a valid probability.
由于浮点算术运算,可以计算出一个数字,应该代表一个概率小于零或大于1。这个函数返回的值是一个有效的概率。