Is there a way to mathematically transform any given number into 1 but keep the original number's signal?

168 Views Asked by At

I was wondering if there is a purely mathematical way to, given any number, transform this number into the number one, keeping the original number's signal. Something like:

  • f(-4) = -1
  • f(5) = 1
  • f(-2.5) = -1
  • f(pi) = 1
  • (. . .)

Is this possible?

1

There are 1 best solutions below

0
On BEST ANSWER

What you are looking for is the function sign which can be defined like this:

$$\mathrm{sgn}\colon x\mapsto \mathrm{sgn}(x)=\frac {\vert x\vert}x.$$

Its graph is:

enter image description here