# Convert numbers between 0 and infinity to numbers between 0.0 and 1.0

Can we arrange all numbers x; such that x lies between 0 and Infinity, between 0 and 1? The scale does not have to be linear, but for any a and b in x, where a <= b, then a' and b', the equivalent numbers on the new scale must also be such that: a' <= b'.

I am really curious about this as I need it for a ratings system.

Thanks!

• "The scale does not have to be linear" how fortunate! – mdup Feb 17 at 19:44
• @mdup, lol!, yeah... I have very mild requirements.... until something changes lol – gbenroscience Feb 17 at 22:12

$$\exp$$ is a great tool, but there's also $$x \mapsto \frac{x^2}{1+x^2}$$ which may be slightly easier to work with in some situations.

As @Servaes points out, you can also use $$x \mapsto \frac{x}{1+x}$$ because you're working on the nonnegative reals rather than all reals.

And a personal favorite of mine is $$x \mapsto \frac{2}{\pi} \arctan(x).$$

• And in fact there is no need for the squares as the function is needed on the nonnegative reals only. – Servaes Feb 17 at 11:37
• Good point. Edited. – John Hughes Feb 17 at 11:41

There are many options, one example is the function $$f(x)=e^{-x}$$. It maps the domain $$(0,\infty)$$ onto the range $$(0,1)$$, though it reverses the ordering. That is, if $$x then $$f(x)>f(y)$$. This is of course easily fixed by taking $$g(x)=1-f(x)=1-e^{-x},$$ instead.

• $6$ seconds before me! – Peter Foreman Feb 17 at 11:31
• @PeterForeman Either this is a rather canonical answer, or you are very fast at paraphrasing. – Servaes Feb 17 at 11:32
• Are you sure this satisfies the second requirement? – Keatinge Feb 17 at 11:33
• Given that if $a\leq b$ then $a'\leq b'$ I think $1-e^{-x}$ should be what OP is looking for. – Infiaria Feb 17 at 11:34
• Wow, I . am impressed with the dexterity and eagerness here. Thanks so much for helping out! I have to accept the other answer by @John Hughes, though. Because I need the answers not to converge too quickly towards 1. Thanks all the same! – gbenroscience Feb 17 at 11:56

The expression you are looking for is a one-to-one mapping from positive reals into $$[0,1]$$. Consider the exponential mapping $$f_k(x) = exp(- (x^k))$$. Other people suggested $$f_2$$. There exist other mappings.