zoukankan      html  css  js  c++  java
  • Java初体验之float type

    Both C and Java define floating-point types named float and double, which
    represent single- and double-precision floating-point values, respectively. Java
    floating-point types are, however, represented in a completely different format from
    their C/C++ counterparts. As in C, Java floating-point values can be represented
    with an exponential portion.

    The float type in C is used to store a signed floating-point number value. The
    exact size of the float type is specified by the compiler, but in general the int type
    is 32 bits (including a sign bit), yielding a range of approximately -34.4E-38 through
    3.4E+38. The float type can generally be used safely to store values of six to
    seven digits of precision.

    The Java float is also used to store signed floating-point number values, but the
    language specifies that 32 bits (including a sign bit) are always used to store IEEE
    754 floating-point values. Floating-point literals are assumed to be of type double,
    so if you specify a float literal you need to append the letter f or F.
    The double type in C is used to store a signed floating-point number value. The
    exact size of the double type is specified by the compiler, but in general the
    double type is 64 bits (including a sign bit), yielding a range of approximately
    -1.7E-308 through 1.7E-308. The double type can generally be used safely to store
    values of 14 to 15 digits of precision.
    The Java double is also used to store signed floating-point number values, but the
    language specifies that 64 bits (including a sign bit) are always used to store IEEE
    754 floating-point values. Floating-point literals are always assumed to be of type
    double, but you can append the letter d or D if you wish.

  • 相关阅读:
    Asp.net2.0页面执行顺序
    [转帖]常用的SQL语句
    [转帖]黑客技术经典问题FAQ
    面试的一些心得
    较全的正则表达式
    很好的创业建议
    [转帖]如何让菜单项与工具栏按钮对应
    源码下载网站
    [转帖]一段测试代码
    GOF设计模式趣解(23种设计模式) <转自百度空间>
  • 原文地址:https://www.cnblogs.com/allenblogs/p/2239226.html
Copyright © 2011-2022 走看看