gpt4 book ai didi

c# - M 在 C# 十进制文字表示法中代表什么?

转载 作者:IT王子 更新时间:2023-10-29 03:28:42 24 4
gpt4 key购买 nike

为了使用十进制数据类型,我必须通过变量初始化来做到这一点:

decimal aValue = 50.0M;

M部分代表什么?

最佳答案

正如其他人所说,这意味着它是一个十进制文字。但是,来源可能不是本答案其他地方建议的来源。来自C# Annotated Standard (ECMA 版本,不是 MS 版本):

The decimal suffix is M/m since D/d was already taken by double. Although it has been suggested that M stands for money, Peter Golde recalls that M was chosen simply as the next best letter in decimal.

一个类似的注释提到,C# 的早期版本包括“Y”和“S”,分别代表 byteshort 文字。它们因不太有用而被丢弃。

关于c# - M 在 C# 十进制文字表示法中代表什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/977484/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com