This module, fniHexUtil64
contains procedures for working with hexadecimal strings and int64 data type.
Note
This module treats hexadecimal strings as bit values represented by hexadecimal digits and not real numbers. Thus, hexadecimal strings parse by this module will be converted to int64 values as if they are real bit values represented by hexadecimal digits.
Note
Procedures of this module are not pure procedures.
Uses
Functions
public function hexToInt64(input, output, startpos, endpos) result(error)
- Author
- Khang Hoang Nguyen
- Since
- 1n.0.0.f
Parse the input
string as bits represented by hexadecimal digits to an int64 value.
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input | A string to be parsed as a hexadecimal string to an int64 value. | ||
integer(kind=k_int64), | intent(out) | :: | output | An int64 value of the | ||
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 logical
public function hexToInt64TrueError(input, output, startpos, endpos) result(error)
- Author
- Khang Hoang Nguyen
- Since
- 1n.0.0.f
Parse the input
string as bits represented by hexadecimal digits to an int64 value.
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input | A string to be parsed as a hexadecimal string to an int64 value. | ||
integer(kind=k_int64), | intent(out) | :: | output | An int64 value of the | ||
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)
public function hexCompareAsInt64(firstString, secondString, output) result(error)
- Author
- Khang Hoang Nguyen
- Since
- 1n.0.0.f
Compare two strings as hexadecimal strings by parsing them to int64 values first.
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | firstString | A string to be compared to the string | ||
character(len=*), | intent(in) | :: | secondString | A string to be compared to the string | ||
integer(kind=k_int32), | intent(out) | :: | output | An int32 value of 1 if the |
Return Value logical
public function hexInt64OrSmaller(firstString, secondString)
- Author
- Khang Hoang Nguyen
- Since
- 1n.0.0.f
Compare two strings bases on the content of the strings reference to int64 values. If the strings are valid hexadecimal strings that can be parsed to int64 values then they will be compared base on their int64 values. Otherwise, the strings will be compared base on the priority ranking order below.
Arguments
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | firstString | A string to be compared to the string | ||
character(len=*), | intent(in) | :: | secondString | A string to be compared to the string |