Mathematical notation for 1 if true, 0 if false function

844 Views Asked by At

It is quite embarrassing, but I completely forgot the generally accepted short notation of writing $1$ if predicate $P$ is true, $0$ if predicate $P$ is false.

I'm pretty sure something like that exists because I saw a notation expressing this in a few presentations and it was mostly coherent.

The operator looked somewhat like this $\|P\|$, but it definitely did not share the symbol with norm.

I am asking because I plan to write something like $\sum_{i=1}^{n}\|P_i\|$ and I think that writing it with if-else notation would be ugly.