dble Interface

public interface dble

Contents


Module Procedures

private impure elemental function dble_s2v(chars)

NAME

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

SYNOPSIS

impure elemental function dble(string)

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

DESCRIPTION

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

OPTIONS

   STRING  input string to be converted to a dble value

RETURNS

DBLE  double precision value represented by input string

EXAMPLE

Sample program:

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

Results:

  >    100.00000000000000        20.399999999999999
  >  dble still works   20.000000000000000 20.399999618530273
  >  elemental   10.00000000000000  20.30000000000000
  >  20.50000000000000 20.60000000000000

AUTHOR

John S. Urban

LICENSE

Public Domain

Arguments

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

Return Value doubleprecision