decToInt128TrueError Function

public function decToInt128TrueError(input, output, startpos, endpos) result(error)

Parse the input string as a signed decimal integer string to an int128 value.

This function ignores leading and trailing whitespaces.

This function return an int32 value of 0 on successful parse cases or a true error code on unsuccessful parse cases.

Error codes:
0 - none
1 - empty strings
2 - invalid format
3 - underflow
4 - overflow
5 - Invalid argument endpos/startpos

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: input

A string to be parsed as a signed decimal integer string to an int128 value.

integer(kind=k_int128), intent(out) :: output

An int128 value of the input string if no error has occurred during parsing.

integer(kind=k_int32), intent(in), optional :: startpos

An int32 value of the position(inclusive) of where to start parsing.

integer(kind=k_int32), intent(in), optional :: endpos

An int32 value of the position(inclusive) of where to end parsing.

Return Value integer(kind=k_int32)