Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 0 和 m 之间的数字映射到 0 和 1 之间,但 m 是不确定的并且大约是大数字。我如何将这些数字非线性地映射到 0 和一个不确定的大数之间以介于 0 和 1 之间。我使用了 arctan 函数,但它不是很好和统一的。
好吧,如果您想要一个非线性函数将任意正实数域映射到实数 [0,1] 的余域,那么理论上您可以使用:
f(x) = x / (x + 1)
该函数在所有点 [0,infinity) 处都是连续的。
但是,您必须意识到浮点数的位数是有限的。在某些时候,根据实现会发生冲突。