C Library Functions  - real (3)

NAME

real(3f) - [M_strings:TYPE] overloads REAL(3f) so it can handle character arguments (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

impure elemental function real(string)

    character(len=*) :: string
    integer          :: real

DESCRIPTION

real(3f) returns a REAL value when given a numeric representation of a numeric value. This overloads the REAL(3f) intrinsic so that CHARACTER arguments assumed to represent a numeric value may be input.

OPTIONS

STRING input string to be converted to a real value

RETURNS

REAL real value represented by input string

EXAMPLE

Sample program:

     program demo_real
     use M_strings, only: real
     implicit none
     write(*,*)real(’100’),real(’20.4’)
     write(*,*)’real still works’,real(20)
     write(*,*)’elemental’,&
     & real([character(len=23) :: ’10’,’20.3’,’20.5’,’20.6’])
     end program demo_real

Results:

     >    100.000000       20.3999996
     >  real still works   20.0000000
     >  elemental   10.0000000  20.2999992  20.5000000  20.6000004

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 real (3) July 22, 2023
Generated by manServer 1.08 from 18da550e-2a9a-4ef8-9b18-e8977b892774 using man macros.