Decode a base64 code into a scalar number (R4P).
use befor64 use penf real(R4P) :: scalar_R4 call b64_decode(code='AAAAAA==',n=scalar_R4) print "(L1)", scalar_R4==0._R4P
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | code | Encoded scalar. |
||
real(kind=R4P), | intent(out) | :: | n | Number to be decoded. |
elemental subroutine b64_decode_R4(code, n)
!< Decode a base64 code into a scalar number (R4P).
!<
!<```fortran
!< use befor64
!< use penf
!< real(R4P) :: scalar_R4
!< call b64_decode(code='AAAAAA==',n=scalar_R4)
!< print "(L1)", scalar_R4==0._R4P
!<```
!=> T <<<
character(*), intent(in) :: code !< Encoded scalar.
real(R4P), intent(out) :: n !< Number to be decoded.
integer(I1P), allocatable :: nI1P(:) !< One byte integer array containing n.
allocate(nI1P(1:BYR4P)) ; nI1P = 0_I1P
call decode_bits(code=code,bits=nI1P)
n = transfer(nI1P,n)
endsubroutine b64_decode_R4