tem_float_module Module

Floating point numbers need a special treatment due to their storage format.

Some people already made up their minds about those things, thus that we can make use of their findings. See further: - http://www.floating-point-gui.de/errors/comparison/ - https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ - http://www.ssec.wisc.edu/~paulv/Fortran90/Utility/Compare_Float_Numbers.f90.html

Most of this modules code traces back to the work of Paul van Delst, CIMSS/SSEC, paul.vandelst@ssec.wisc.edu


Uses

  • module~~tem_float_module~~UsesGraph module~tem_float_module tem_float_module module~env_module env_module module~tem_float_module->module~env_module module~aotus_module aotus_module module~env_module->module~aotus_module module~flu_binding flu_binding module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env mpi mpi module~env_module->mpi

Used by

  • module~~tem_float_module~~UsedByGraph module~tem_float_module tem_float_module module~tem_sparta_module tem_Sparta_module module~tem_sparta_module->module~tem_float_module program~tem_float_test tem_float_test program~tem_float_test->module~tem_float_module program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->module~tem_float_module module~tem_geometry_module tem_geometry_module module~tem_geometry_module->module~tem_float_module module~tem_condition_module tem_condition_module module~tem_condition_module->module~tem_float_module module~tem_canonicalnd_module tem_canonicalND_module module~tem_canonicalnd_module->module~tem_float_module module~tem_polygon_material_module tem_polygon_material_module module~tem_polygon_material_module->module~tem_float_module program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->module~tem_float_module module~tem_intersection_module tem_intersection_module module~tem_intersection_module->module~tem_float_module program~tem_growarray_test tem_growArray_test program~tem_growarray_test->module~tem_float_module module~tem_matrix_module tem_matrix_module module~tem_matrix_module->module~tem_float_module module~tem_line_module tem_line_module module~tem_line_module->module~tem_float_module program~tem_tools_test tem_tools_test program~tem_tools_test->module~tem_float_module module~tem_cylinder_module tem_cylinder_module module~tem_cylinder_module->module~tem_float_module module~tem_logical_operation_var_module tem_logical_operation_var_module module~tem_logical_operation_var_module->module~tem_float_module

Contents


Interfaces

private interface operator (.feq.)

  • private elemental function equal(a, b) result(res)

    Relational operator to test the equality of floating point numbers.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operands are equal to within numerical precision.

  • private pure function equal_array(a, b) result(res)

    Relational operator to test the equality of two arrays of floating point numbers.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a(:)

    Floating point array to be compared.

    real(kind=rk), intent(in) :: b(:)

    Floating point array to be compared.

    Return Value logical

    The result is a logical value indicating whether the operands are equal to within numerical precision.

private interface operator (.fne.)

  • private elemental function notEqual(a, b) result(res)

    Relational operator to test the not-equality of floating point numbers.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operands are not equal to within numerical precision.

  • private pure function notEqual_array(a, b) result(res)

    Relational operator to test the not-equality of two floating point arrays.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a(:)

    Floating point array to be compared.

    real(kind=rk), intent(in) :: b(:)

    Floating point array to be compared.

    Return Value logical

    The result is a logical value indicating whether the operands are not equal to within numerical precision.

private interface operator (.fgt.)

  • private elemental function greaterThan(a, b) result(res)

    Relational operator to test if one operand is greater than another.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operand a is greater than b by more than the spacing between representable floating point numbers.

private interface operator (.fge.)

  • private elemental function greaterThanOrEqual(a, b) result(res)

    Relational operator to test if one operand is greater than or equal to another.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operand a is greater than or equal to b by more than the spacing between representable floating point numbers.

private interface operator (.flt.)

  • private elemental function lessThan(a, b) result(res)

    Relational operator to test if one operand is less than another.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operand a is less than b by more than the spacing between representable floating point numbers.

private interface operator (.fle.)

  • private elemental function lessThanOrEqual(a, b) result(res)

    Relational operator to test if one operand is less than or equal to another.

    Arguments

    TypeIntentOptionalAttributesName
    real(kind=rk), intent(in) :: a

    Floating point value to be compared.

    real(kind=rk), intent(in) :: b

    Floating point value to be compared.

    Return Value logical

    The result is a logical value indicating whether the operand a is less than or equal to b by more than the spacing between representable floating point numbers.


Functions

private elemental function equal(a, b) result(res)

Relational operator to test the equality of floating point numbers.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operands are equal to within numerical precision.

private pure function equal_array(a, b) result(res)

Relational operator to test the equality of two arrays of floating point numbers.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a(:)

Floating point array to be compared.

real(kind=rk), intent(in) :: b(:)

Floating point array to be compared.

Return Value logical

The result is a logical value indicating whether the operands are equal to within numerical precision.

private elemental function notEqual(a, b) result(res)

Relational operator to test the not-equality of floating point numbers.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operands are not equal to within numerical precision.

private pure function notEqual_array(a, b) result(res)

Relational operator to test the not-equality of two floating point arrays.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a(:)

Floating point array to be compared.

real(kind=rk), intent(in) :: b(:)

Floating point array to be compared.

Return Value logical

The result is a logical value indicating whether the operands are not equal to within numerical precision.

private elemental function greaterThan(a, b) result(res)

Relational operator to test if one operand is greater than another.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operand a is greater than b by more than the spacing between representable floating point numbers.

private elemental function greaterThanOrEqual(a, b) result(res)

Relational operator to test if one operand is greater than or equal to another.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operand a is greater than or equal to b by more than the spacing between representable floating point numbers.

private elemental function lessThan(a, b) result(res)

Relational operator to test if one operand is less than another.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operand a is less than b by more than the spacing between representable floating point numbers.

private elemental function lessThanOrEqual(a, b) result(res)

Relational operator to test if one operand is less than or equal to another.

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: a

Floating point value to be compared.

real(kind=rk), intent(in) :: b

Floating point value to be compared.

Return Value logical

The result is a logical value indicating whether the operand a is less than or equal to b by more than the spacing between representable floating point numbers.