Assignment operator from real input.
use penf
type(string) :: astring
logical :: test_passed(1)
astring = 3.021e6_R8P
test_passed(1) = astring%to_number(kind=1._R8P)==3.021e6_R8P
print '(L1)', all(test_passed)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(inout) | :: | lhs |
Left hand side. |
||
real(kind=R16P), | intent(in) | :: | rhs |
Right hand side. |
pure subroutine string_assign_real_R16P(lhs, rhs)
!< Assignment operator from real input.
!<
!<```fortran
!< use penf
!< type(string) :: astring
!< logical :: test_passed(1)
!< astring = 3.021e6_R8P
!< test_passed(1) = astring%to_number(kind=1._R8P)==3.021e6_R8P
!< print '(L1)', all(test_passed)
!<```
!=> T <<<
class(string), intent(inout) :: lhs !< Left hand side.
real(R16P), intent(in) :: rhs !< Right hand side.
lhs%raw = trim(str(rhs))
endsubroutine string_assign_real_R16P