fnBinaryUtil64 Module

This module, fnBinaryUtil64 contains procedures for working with binary strings and int64 data type.



Functions

public pure function binaryInt64OrSmaller(firstString, secondString) result(int32Out)
Author
Khang Hoang Nguyen
Since
1.0.0.f

Compare two strings bases on the content of the strings reference to int64 values. If the strings are valid binary 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.

Read more…

Arguments

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

A string to be compared to the string secondString.

character(len=*), intent(in) :: secondString

A string to be compared to the string firstString.

Return Value integer(kind=k_int32)


Subroutines

public pure subroutine binaryToInt64(input, output, error, startpos, endpos)
Author
Khang Hoang Nguyen
Since
1.0.0.f

Parse the input string as bits represented by binary digits to an int64 value.

Read more…

Arguments

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

A string to be parsed as a binary string to an int64 value.

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

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

logical, intent(out) :: error

A value of .TRUE. if an error has occurred during parsing, or .FALSE., otherwise.

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.

public pure subroutine binaryToInt64TrueError(input, output, error, startpos, endpos)
Author
Khang Hoang Nguyen
Since
1.0.0.f

Parse the input string as bits represented by binary digits to an int64 value.

Read more…

Arguments

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

A string to be parsed as a binary string to an int64 value.

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

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

integer(kind=k_int32), intent(out) :: error

An int32 value of 0 on successful parse cases or a true error code on unsuccessful parse cases.

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.

public pure subroutine binaryCompareAsInt64(firstString, secondString, output, error)
Author
Khang Hoang Nguyen
Since
1.0.0.f

Compare two strings as binary strings by parsing them to int64 values first.

Read more…

Arguments

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

A string to be compared to the string secondString.

character(len=*), intent(in) :: secondString

A string to be compared to the string firstString.

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

An int32 value of 1 if the firstString is larger than the secondString, 0 if they are both equal, or -1 if the firstString is smaller than the secondString. This value may not be a correct value if an error has occurred during parsing either one of the input strings.

logical, intent(out) :: error

A value of .TRUE. if an error has occurred during parsing either one of the input strings. Otherwise, a value of .FALSE..