bit_size(x): Tamanho em Bits

Bit size.

Declaration

Sintaxe

retval = bit_size(x);
elemental logical function bit_size(x)

Argumentos

x is integer input value.

Valores de retorno

The return value is of type integer.

Descrição

bit_size(x) calculates the number of bits including sign bit of binary representation of x.

Tipos

Supported input types is integer.

module lfortran_intrinsic_builtin
implicit none

contains

interface
    integer function bit_size(x)
	integer, intent(in) :: x
	end function
end interface

Exemplos

program intrinsics_bit_size
    implicit none
    print *, bit_size(123)
	print *, bit_size(-1)
end program

Resultado:

32
32

Veja Também