The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Convert::ToDouble Method (Single)
.NET Framework (current version)
Converts the value of the specified single-precision floating-point number to an equivalent double-precision floating-point number.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- value
-
Type:
System::Single
The single-precision floating-point number.
Return Value
Type: System::DoubleA double-precision floating-point number that is equivalent to value.
The following example converts a Single value to a Double value.
public: void CovertDoubleFloat( double doubleVal ) { float floatVal = 0; // A conversion from Double to Single cannot overflow. floatVal = System::Convert::ToSingle( doubleVal ); System::Console::WriteLine( " {0} as a float is {1}", doubleVal, floatVal ); // A conversion from Single to Double cannot overflow. doubleVal = System::Convert::ToDouble( floatVal ); System::Console::WriteLine( " {0} as a double is: {1}", floatVal, doubleVal ); }
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: