Trusted answers to developer questions

Theodore Kelechukwu Onyejiaku

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

** Decimal.MinValue** is a field in C# that represents the smallest possible value of

`decimal`

. It is a constant field and read-only, which means that it cannot be modified.public static readonly decimal MinValue;

Syntax to get minimum value of decimal

This field returns the value `-79,228,162,514,264,337,593,543,950,335`

.

// use Systemusing System;// create classclass DecimalMinValue{// main methodstatic void Main(){// print the field valueConsole.WriteLine(Decimal.MinValue);}}

Code snippet to show the minimum value of decimal in C#

**Line 11**: We print the value of the`Decimal.MinValue`

field to the console.

If there is a decimal value that is less than the `Decimal.MinValue`

, the field will throw an error, as this is the minimum value a decimal can be.

// use Systemusing System;// create classclass DecimalMinValue{static void Main(){// add to another// decimal valuedecimal newDecimalNumber = -1.0m + Decimal.MinValue;// print resultConsole.WriteLine(newDecimalNumber);}}

Any decimal value lesser than the Decimal.MinValue throws an error

**Line 10**: We create a decimal variable and initialize it with the sum of`-1.0`

and`Decimal.MinValue`

. This will throw an error because no decimal value is supposed to be less than the`Decimal.MinValue`

field.

RELATED TAGS

decimal

c#

minvalue

communitycreator

CONTRIBUTOR

Theodore Kelechukwu Onyejiaku

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring

Related Courses