-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the issue or suggestion
The "Remarks" section of Decimal.ToDouble contains the following paragraph:
You can also convert a Decimal to a Double value by using the Explicit assignment operator. Because the conversion can entail a loss of precision, you must use a casting operator in C# or a conversion function in Visual Basic.
The last part of the last sentence ("or a conversion function in Visual Basic") is incorrect. VB.NET (unfortunately) allows implicit conversions from Decimal to Double, even with Option Strict On (cf. Section 8.3 of the VB 11 language specification).
Suggested fix:
You can also convert a Decimal to a Double value by using the Explicit assignment operator. Because the conversion can entail a loss of precision, you must use a casting operator in C#. Visual Basic supports implicit conversions from Double to Decimal, rounding to the nearest Double value.
Alternatively, we could just drop the part about Visual Basic (= suggested fix minus the last sentence).