Use an enum to strongly type parameters, properties, and return types.

This enhances clarity and type-safety. Try to avoid casting between enumerated types and integral types.

Exception:

In some cases, such as when databases or MIT interfaces that store values as ints are involved, using enums will result in an unacceptable amount of casting. In that case, it is better to use a const int construction.

Avoid changing the underlying type of an enum

If the enum represents flags and there are currently more than 32 flags, or the enum might grow to that many flags in the future, use Int64.

Do not use any other underlying type because the Operating System will try to align an enum on 32-bit or 64-bit boundaries (depending on the hardware platform). Using a 8-bit or 16-bit type may result in a performance loss.

Floating point values shall not be compared using either the == or != operators.

Most floating point values have no exact binary representation and have a limited precision.

Exception:
When a floating point variable is explicitly initialized with a value such as 1.0 or 0.0, and then checked for a change at a later stage.

Java script Considerations when using Floating point data

When Performing Floating point operations in JavaScript, Most developers do not take into account how JavaScript behaves.

Always use toFixed() Function to round off your floating point values.

When performing any operations on any Currency values, always use the Math object.

Do not cast types where a loss of precision is possible.

For example, do not cast a long (64-bit) to an int (32-bit), unless you can guarantee that the value of the long is small enough to fit in the int.

Do not generate a semantically different value with a cast.

For example, it is appropriate to convert a Time or TimeSpan into an Int32. The Int32 still represents the time or duration. It does not, however, make sense to convert a file name string such as c:\mybitmap.gif into a Bitmap object.