什么是“d”?字面上的 12d 叫做?

发布于 2024-09-03 12:32:58 字数 420 浏览 2 评论 0原文

我觉得我应该知道这个问题的答案,但我不知道。

数字文字上的类型字符称为什么?

double myDouble = 12d;
float myFloat = 10f;

我今天想找到它们的完整列表,但无法想出要谷歌搜索的内容。

编辑

如果有人感兴趣的话找到一个不错的列表

http://www.undermyhat.org/blog/2009/08/secrets-and-lies-of-type-suffixes-in-c-and-vb-net/

I feel like I should know the answer to this, but I don't.

What is the type character on a numeric literal called?

double myDouble = 12d;
float myFloat = 10f;

I wanted to find a complete list of them today, but couldn't come up with what to ask Google to search for.

EDIT

Found a decent list if anyone is interested

http://www.undermyhat.org/blog/2009/08/secrets-and-lies-of-type-suffixes-in-c-and-vb-net/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

合久必婚 2024-09-10 12:32:58

它称为数据类型后缀。

It's called a data type suffix.

著墨染雨君画夕 2024-09-10 12:32:58

我不知道是否有官方术语,但 C# 语言规范通常将它们称为类型后缀。

I don't know if there is an official term but the C# language spec commonly refers to them as type suffixes.

入怼 2024-09-10 12:32:58

数字文字后缀

列表:

  • uint: u
  • long: l
  • ulong: ul
  • float: f
  • decimal :米

Numeric Literal Suffix

A list:

  • uint: u
  • long: l
  • ulong: ul
  • float: f
  • decimal: m
活雷疯 2024-09-10 12:32:58

C# 3.0 规范 (MSWord 文件)将它们称为type-suffix,分为两类:integer-type-suffixreal-type-后缀

整数类型后缀包括:
U u - 无符号整数
L l - 长
UL Ul uL ul LU Lu lU lu - unsigned long

实数类型后缀包括:
F f - 浮点数
D d - 双
M m - 十进制

The C# 3.0 specification (MSWord file) refers to them as type-suffix, divided into two categories: integer-type-suffix and real-type-suffix.

integer-type-suffixes include:
U u - unsigned int
L l - long
UL Ul uL ul LU Lu lU lu - unsigned long

real-type-suffixes include:
F f - float
D d - double
M m - decimal

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文