codata_constant_type

NAME
LIBRARY
SYNOPSIS
DESCRIPTION
EXAMPLE
SEE ALSO

NAME

codata_constant_type - derived type

LIBRARY

Codata library (libcodata, -lcodata)

SYNOPSIS

Fortran

type(codata_constant_type) :: c

C

struct codata_constant_type c

DESCRIPTION

Defines a constant with the name, the value, the uncertainty and the unit.

type :: codata_constant_type

character(len=64) :: name

real(dp) :: value

real(dp) :: uncertainty

character(len=32) :: unit

contains

procedure :: print

procedure :: to_real_sp

procedure :: to_real_dp

generic :: to_real => to_real_sp, to_real_dp

end type codata_constant_type

struct codata_constant_type{

char name[65];

double value;

double uncertainty;

char unit[33];

};

EXAMPLE

Fortran:
use codata
type(codata_constant_type), pointer :: c
c = SPEED_OF_LIGHT_IN_VACUUM

C:

include "codata.h"
struct codata_constant_type c;
c = SPEED_OF_LIGHT_IN_VACUUM;

SEE ALSO

codata(3), codata_cli(1), codata_version(3), codata_constant_type(3)