Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

In one of my computer programming projects I have defined the following quite common function:

$$ f(x) = \begin{cases} 0, & \text{ when } x = 0, \\ 1, & \text{ when } x \neq 0. \end{cases} $$

From what I understand, this is essentially an indicator function, more specifically $1_{x \neq 0}$. Unfortunately, most programming languages are quite restrictive in what one can use as an indentifier and mathematical symbols do not generally make the cut.

So, is there a standard name for this function? Something familiar to English-speaking$^1$ scientists that could be used in computer code$^2$?

$^1$ Yes, that means that something in, say, Sanskrit or Chinese would not be of much help.

$^2$ functionThatReturnsZeroForZeroInputAndOneOtherwise is not very helpful either...

share|improve this question
1  
Yes, Kronecker delta, or Characteristic function, or Indicator function, as you said. –  Berci Feb 3 '13 at 14:01
2  
actually, this would be one minus the Kronecker delta. –  J. Loreaux Feb 3 '13 at 14:03
2  
Indeed, $x\mapsto 1-\delta_{0,x}$. In the theory of Boolean algebras (with operators), this is called the switching function or discriminator (though it means some more general thing in universal algebra). –  Berci Feb 3 '13 at 14:05
1  
But, overall, I would call it simply NonZero(x). –  Berci Feb 3 '13 at 14:08
    
@Berci: to be honest I was hoping for a name that would not be confused with a function that returns a boolean value. Something along the lines of nonZeroIndicator() or something... –  thkala Feb 4 '13 at 10:31

1 Answer 1

You might call it normalize () or canonicalize (), since it normalizes/canonicalizes a representation in which false / $0$ is represented by $0$ and true / $1$ can be represented by any non-zero value to a representation in which each of them is represented by only one "canonical" value, which can then be used e.g. in equality comparisons.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.