当前位置: 首页 > news >正文

龙岩网站建设要多少费用非响应式网站改响应式

龙岩网站建设要多少费用,非响应式网站改响应式,WordPress错误返回,wordpress自动评论插件C#中的数字字面量后缀及其作用 | Numeric Literal Suffixes and Their Usage in C# 在C#编程中,我们经常需要使用不同类型的数字,如整数、浮点数和高精度数字等。为了方便表示这些数字并明确其数据类型,C#提供了各种数字字面量后缀。本文将通过实例详细介绍这些后缀的作用和用…C#中的数字字面量后缀及其作用 | Numeric Literal Suffixes and Their Usage in C# 在C#编程中,我们经常需要使用不同类型的数字,如整数、浮点数和高精度数字等。为了方便表示这些数字并明确其数据类型,C#提供了各种数字字面量后缀。本文将通过实例详细介绍这些后缀的作用和用法。 When programming in C#, we often need to use different types of numbers, such as integers, floating-point numbers, and high-precision numbers. To facilitate the representation of these numbers and clarify their data types, C# provides various numeric literal suffixes. This article will introduce the usage and effects of these suffixes in detail through examples. 1. m或M后缀表示decimal类型 | m or M Suffix for decimal Type decimal类型用于表示高精度的十进制数字。在C#中,我们可以使用m或M后缀来指定一个字面量为decimal类型。 The decimal type is used to represent high-precision decimal numbers. In C#, we can use the m or M suffix to specify a literal as the decimal type. decimal price 9.99m; decimal tax 1.50M; decimal total price tax; Console.WriteLine($Total: {total}); // 输出: Total: 11.492. f或F后缀表示float类型 | f or F Suffix for float Type float类型用于表示单精度浮点数。通过在数字字面量末尾添加f或F后缀,我们可以将其指定为float类型。 The float type is used to represent single-precision floating-point numbers. By appending the f or F suffix to the end of a numeric literal, we can specify it as the float type. float pi 3.14159f; float radius 2.5F; float area pi * radius * radius; Console.WriteLine($Area: {area}); // 输出: Area: 19.634953. d或D后缀表示double类型 | d or D Suffix for double Type double类型用于表示双精度浮点数。如果没有指定后缀,数字字面量默认为double类型。我们也可以显式地使用d或D后缀。 The double type is used to represent double-precision floating-point numbers. If no suffix is specified, the numeric literal defaults to the double type. We can also explicitly use the d or D suffix. double distance 1000.0; double time 3600d; double speed distance / time; Console.WriteLine($Speed: {speed} m/s); // 输出: Speed: 0.277777777777778 m/s4. u或U后缀表示uint类型 | u or U Suffix for uint Type uint类型表示32位无符号整数。通过在整数字面量末尾添加u或U后缀,我们可以将其指定为uint类型。 The uint type represents a 32-bit unsigned integer. By appending the u or U suffix to the end of an integer literal, we can specify it as the uint type. uint age 25u; uint max uint.MaxValue; Console.WriteLine($Age: {age}, Max: {max}); // 输出: Age: 25, Max: 42949672955. l或L后缀表示long类型 | l or L Suffix for long Type long类型表示64位有符号整数。通过在整数字面量末尾添加l或L后缀,我们可以将其指定为long类型。 The long type represents a 64-bit signed integer. By appending the l or L suffix to the end of an integer literal, we can specify it as the long type. long population 7800000000L; long milliseconds 1000L * 60 * 60 * 24; Console.WriteLine($Population: {population}, Milliseconds in a day: {milliseconds}); // 输出: Population: 7800000000, Milliseconds in a day: 864000006. ul、uL、Ul、UL、lu、Lu、lU或LU后缀表示ulong类型 | ul, uL, Ul, UL, lu, Lu, lU, or LU Suffix for ulong Type ulong类型表示64位无符号整数。通过在整数字面量末尾添加ul、uL、Ul、UL、lu、Lu、lU或LU后缀,我们可以将其指定为ulong类型。 The ulong type represents a 64-bit unsigned integer. By appending the ul, uL, Ul, UL, lu, Lu, lU, or LU suffix to the end of an integer literal, we can specify it as the ulong type. ulong bytesInTB 1024uL * 1024 * 1024 * 1024; ulong maxValue ulong.MaxValue; Console.WriteLine($Bytes in a TB: {bytesInTB}, Max Value: {maxValue}); // 输出: Bytes in a TB: 1099511627776, Max Value: 18446744073709551615在编写C#代码时,合理使用数字字面量后缀可以让编译器正确推断数据类型,减少隐式类型转换带来的潜在问题。同时,明确指定数据类型也有助于提高代码的自文档化程度,使其更易于理解和维护。 When writing C# code, proper use of numeric literal suffixes allows the compiler to correctly infer data types and reduces potential issues caused by implicit type conversions. Meanwhile, explicitly specifying data types also helps improve the self-documentation of the code, making it easier to understand and maintain.
http://www.zqtcl.cn/news/884589/

相关文章:

  • 有的网站在浏览器打不开怎么办最近中国新闻热点大事件
  • 网站模板组件随州网站建设有哪些
  • 网站建设微信版8080端口wordpress
  • 急求聊城网站建设微信网页注册入口
  • 商城网站建站程序网站内链布局
  • 盐城网站建设方案全景旅游网站项目建设
  • 网站备案完电信园林效果图网站
  • 伤豆丁文库网站开发贵州网站备案局
  • 做网站的注意什么北京建设协会网站首页
  • 石家庄网站开发设计网站建设重点步骤
  • 推广思路及执行方案昆明百度seo
  • 太原公司网站建立可视化小程序开发工具
  • 怎么做网站的搜索引擎云主机有什么用
  • 淘宝客新增网站南宁百度seo优化
  • 建设厅网站合同备案在哪里网站备案本人承诺
  • 做方案的网站住房城乡建设部官网
  • 怎样在门户网站做 推广天水市建设银行官方网站
  • 温州建网站哪家强网站建设谈客户说什么
  • 网站的子域名怎么设置整站seo排名外包
  • 免费网站在哪下载苏州建设银行网站
  • 邹平 建设项目 网站公示怎样做网站卖自己的产品教程
  • 手机免费网站建设哪家公司好免费动态域名申请
  • 提升网站排名怎么提交自己的网站
  • cms网站开发phpwordpress有什么功能
  • 专业网站制作解决方案自己在家搭建服务器
  • 中小企业网站提供了什么英文营销网站建设
  • 玉环市建设工程检测中心网站网站建设服务的具体条件
  • 主机网站wampserver搭建网站
  • 建设银行网站点不进去深圳龙华区招聘网最新招聘信息
  • 网站建设公司现在还挣钱吗wordpress棋牌