wignerd__characters Module

Contains procedures related to characters and character arrays, such as converting integers to characters



Functions

public recursive function int2char(i) result(output)

Convert the integer i to a character (array) "i"

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i

Return Value character(len=:), allocatable

The integer "i" as a character array, e.g. int2char(2) "2" int2char(16) "16"

public pure elemental function ndigits(n) result(num)

Returns number of characters an integer will occupy

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Return Value integer

The number of characters it takes to represent a number, e.g. ndigits(7) 1 ndigits(-7) 2 ndigits(38) 2 ndigits(3877) 7