What is the term for a variable with a few special values

Viewed 28

What is the term for a variable with a few special values? For example, in many languages, String's indexOf() returns the index or -1 if it cannot find a match.

I know enum refers to variables that can only take on certain values. Is there a term for this type of variable, that has some special values but also infinitely many "regular" values? I couldn't find anything online and it is really bugging me for some reason.

1 Answers

You can use the term magic number, magic string or sentinel value.

Related