Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

double
c#
minvalue
communitycreator

What is the double.Minvalue field in C#?

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.

Overview

In C#, Double.MinValue represents the smallest possible value of a double. It is a constant.

Syntax

public const double MinValue
Syntax for the Decimal.MinValue field in C#

Parameters

This field takes no parameters.

Return value

This field returns -1.7976931348623157E+308.

Example

// use System
using System;
// create class
class DoubleMinValue
{
static void Main()
{
// print value of field
Console.WriteLine(Decimal.MinValue);
// perform arithmetic operations
double d1 = Double.MinValue + 45.8695;
double d2 = 1 * Double.MinValue;
double d3 = Double.MinValue + Double.MinValue;
// print result
Console.WriteLine(d1);
Console.WriteLine(d2);
Console.WriteLine(d3);
}
}
Code to demonstrate the Double.MinValue field in C#

Explanation

  • Line 9: We print the value of Double.MinValue to the console.
  • Line 11–13: We perform some arithmetic operations on the field and store results in d1 , d2 and d3 variables.
  • Line 16–18: We print the results to the console.

RELATED TAGS

double
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