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.

  • 相关阅读:
    2014/7/24
    POJ 3414 Pots BFS
    hdu5119 Happy Matt Friends(dp)
    hdu1285 拓扑排序+优先队列
    串口參数具体解释:波特率,数据位,停止位,奇偶校验位
    浅谈软件销售工作
    设计模式及其学习方法的个人理解
    Apache + Tomcat + JK 集群
    SpringMVC案例2----基于spring2.5的注解实现
    poj
  • 原文地址:https://www.cnblogs.com/allenblogs/p/2239226.html
Copyright © 2011-2022 走看看