9.48. BIT_SIZE

9.48 BIT_SIZE — Bit size inquiry function

Description:

BIT_SIZE(I) returns the number of bits (integer precision plus sign bit) represented by the type of I. The result of BIT_SIZE(I) is independent of the actual value of I.

Standard:

Fortran 95 and later

Class:

Inquiry function

Syntax:

RESULT = BIT_SIZE(I)

Arguments:
I The type shall be INTEGER.
Return value:

The return value is of type INTEGER

Example:
program test_bit_size
    integer :: i = 123
    integer :: size
    size = bit_size(i)
    print *, size
end program test_bit_size

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gfortran/BIT_005fSIZE.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部