zoukankan      html  css  js  c++  java
  • C# floating Point types

    The tradeoff between decimal and double is precision versus range. The decimal is the best choice when precision is required, but choose a double for the greatest range. The decimal
    type is well suited for financial calculations, as shown in the following example:
    decimal annualSales = 99873582948769876589348317.95m;

    A final word on literal suffixes: There are common suffixes for each literal type. Suffixes ensure that the literal is the intended type. This is good for documentation. However, the
    primary benefit is ensuring that your expressions are evaluated correctly; that is, the compiler will interpret float and decimal literals without suffixes as a double when evaluating
    an expression. To avoid the associated errors, use an appropriate literal suffix (f/F, d/D, m/M).

  • 相关阅读:
    Python 字符串
    python 元组用法
    python 字典用法
    环境配置
    桥式整流以及电容作用
    三角序列的正交性
    MDS
    ISOMAP
    randperm
    数据库~Mysql里的Explain说明
  • 原文地址:https://www.cnblogs.com/taoxu0903/p/1670564.html
Copyright © 2011-2022 走看看