From: Eric S. Raymond Date: Wed, 18 Feb 2004 11:01:44 +0000 (+0000) Subject: Added example 3. X-Git-Tag: 1.0~82 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=32458a035b234ad4d9ab59eb8fb5c2f881c661c7;p=mad.git Added example 3. --- diff --git a/doc/flowchart.pic b/doc/flowchart.pic index 4fb2561..4c2b1f7 100644 --- a/doc/flowchart.pic +++ b/doc/flowchart.pic @@ -1,4 +1,5 @@ define terminal {box $1 ht 0.3 rad 0.2} +define bigterminal {box $1 ht 0.6 wid 1.8 rad 0.3} define diamond {[ FRAME: box invis "$1" $2 $3 $4 @@ -96,5 +97,7 @@ define label {[ circle rad 0.2 with .c at FRAME.c ]} + + # It would be nice to make this work inside [], but pic refuses define annotate {$2 at $1.end + (-0.1,0.1)} diff --git a/doc/mad-manual.xml b/doc/mad-manual.xml index 694c060..eef3f59 100644 --- a/doc/mad-manual.xml +++ b/doc/mad-manual.xml @@ -7,6 +7,8 @@ + + @@ -3089,7 +3091,46 @@ external function or an internal function. +The Program: + + +&simpsfunc; + + +If, for some reason, the integral of sin 3x - cos(rx + 1) were +needed if 0 ≤ x ≤ 3, and the integral of sin 3x - cos(rx) +otherwise, the program might then be as follows: + +The Program: + + +&simpsmain; + + +External Functions: + +&simpsfunc; +*DATA + 0 2. 10 10. + + +An alternate way tio write the first eight lines of this +program, illustrating one use of the FUNCTION NAME mode, would +be: + + +READ READ FORMAT INPUTS,A,B,N,R + INTEGER N + WHENEVER 0. .LE. R .AND. R .LE. 3 + S = F1. + OTHERWISE + S = F2. + END OF CONDITIONAL + PRINT FORMAT RESULT,A,B,N,R,SIMPS.(A,B,N,S) + TRANSFER TO READ + FUNCTION NAME S +