real Interface

public interface real

Contents


Module Procedures

private impure elemental function real_s2v(chars)

NAME

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

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

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: chars

Return Value real