Counts the number of digits of an integer, including the - sign in case it is a negative value.
n = count_digits_integer(i)
Where:
i
: Integer number whose digits are to be countedIt returns the number of digits of the input number, including the - sign in case it is a negative value.
The following program prints the number of digits of some integer numbers:
PROGRAM count_digits_integerExample
USE FU_Numbers, ONLY: count_digits_integer
IMPLICIT NONE
WRITE(*,*) count_digits_integer(1234)
WRITE(*,*) count_digits_integer(-1234)
END PROGRAM count_digits_integerExample
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i8), | intent(in) | :: | i |
Integer number whose digits are to be counted. |
The number of digits of the input number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i16), | intent(in) | :: | i |
Integer number whose digits are to be counted. |
The number of digits of the input number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32), | intent(in) | :: | i |
Integer number whose digits are to be counted. |
The number of digits of the input number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64), | intent(in) | :: | i |
Integer number whose digits are to be counted. |
The number of digits of the input number.