Defining different types of numbers in C#

后端 未结 3 1353
清酒与你
清酒与你 2020-12-16 11:55

You can define a number in various ways in C#,

1F // a float with the value 1
1L // a long with the value 1
1D // a double with the value 1

3条回答
  •  半阙折子戏
    2020-12-16 12:38

    Integer

    Suffix - Description

    none - first of int, uint, long and ulong

    U or u - first of uint, ulong

    L or l - first of long, ulong

    UL, Ul, uL, ul, LU, Lu, lU, or lu - ulong

    Real

    Suffix - Description

    none - double

    F or f - float

    D or d - double

    M or m - decimal

提交回复
热议问题