C#

C#

By DeepSource

Consider using the constants from the Math class CS-R1071

Anti-pattern

Constants such as pi, e, and tau are already defined in the Math class. Consider using them instead of manually defining the literal yourself. This makes it easier to read and follow the code.

Bad Practice

var pi = 3.14;

Recommended

var pi = Math.PI;