I'm working on a program in C# where a Decimal variable can hold negative and positive values including 0 and those values can only change by addition and subtraction.
I have a conditional where if the result is false, the value of this variable is set to a specific number so the program knows to ignore it everywhere else in the program.
I am having a hard time picking this number that is unlikely to be produced by addition or subtraction and is unique enough to be used as a 'toggle' to ignore the variable or not.
So can a number like 1.01010101 be a suitable candidate? This variable, according the business model of my program, is holding megawatt values that are only added or subtracted from and it's never going to be used to add 1.0 + 0.01 + 0.0001 +... It will just be adding a number with a max of 2 significant figures.
Since Decimals in C# don't support NaNs, you can use very large number like maximum supported by Decimal (79228162514264337593543950335).
Working with that large numbers as normal values wouldn't be safe against overflows, so it could be used as an indicator.