100% found this document useful (2 votes)
14 views

Full Download Practical Numerical C Programming 1st Edition Philip Joyce PDF DOCX

Programming

Uploaded by

zandtpardiht
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
14 views

Full Download Practical Numerical C Programming 1st Edition Philip Joyce PDF DOCX

Programming

Uploaded by

zandtpardiht
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Practical Numerical C Programming 1st Edition


Philip Joyce

https://textbookfull.com/product/practical-numerical-c-
programming-1st-edition-philip-joyce/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Practical Numerical C Programming: Finance, Engineering,


and Physics Applications Philip Joyce

https://textbookfull.com/product/practical-numerical-c-programming-
finance-engineering-and-physics-applications-philip-joyce/

textboxfull.com

Java Programming Joyce Farrell

https://textbookfull.com/product/java-programming-joyce-farrell/

textboxfull.com

Java Programming Joyce Farrell

https://textbookfull.com/product/java-programming-joyce-farrell-2/

textboxfull.com

Practical Anesthetic Management The Art of Anesthesiology


1st Edition C. Philip Larson Jr.

https://textbookfull.com/product/practical-anesthetic-management-the-
art-of-anesthesiology-1st-edition-c-philip-larson-jr/

textboxfull.com
Visual C and Databases A Step By Step Database Programming
Tutorial 15th Edition Philip Conrod

https://textbookfull.com/product/visual-c-and-databases-a-step-by-
step-database-programming-tutorial-15th-edition-philip-conrod/

textboxfull.com

Visual C For Kids A Step by Step Computer Programming


Tutorial 15th Edition Philip Conrod

https://textbookfull.com/product/visual-c-for-kids-a-step-by-step-
computer-programming-tutorial-15th-edition-philip-conrod/

textboxfull.com

Practical System Programming with C 1st Edition Sri


Manikanta Palakollu Palakollu Sri Manikanta

https://textbookfull.com/product/practical-system-programming-
with-c-1st-edition-sri-manikanta-palakollu-palakollu-sri-manikanta/

textboxfull.com

Learning cython programming 2nd Edition Philip Herron

https://textbookfull.com/product/learning-cython-programming-2nd-
edition-philip-herron/

textboxfull.com

Doing Right: A Practical Guide to Ethics for Medical


Trainees and Physicians 4th Edition Philip C. Hebert

https://textbookfull.com/product/doing-right-a-practical-guide-to-
ethics-for-medical-trainees-and-physicians-4th-edition-philip-c-
hebert/
textboxfull.com
Philip Joyce

Practical Numerical C Programming


Finance, Engineering, and Physics
Applications
1st ed.
Philip Joyce
Goostrey, UK

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​978-1-4842-6127-9. For
more detailed information, please visit http://​www.​apress.​com/​
source-code.

ISBN 978-1-4842-6127-9 e-ISBN 978-1-4842-6128-6


https://doi.org/10.1007/978-1-4842-6128-6

© Philip Joyce 2020

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

Distributed to the book trade worldwide by Apress Media, LLC, 1 New


York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax
(201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the
sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Introduction
The C programming language is an important language in many
computer applications. It is the basis of C++ and C#. This book will
demonstrate how to use the C language to solve problems in finance,
commercial/industrial systems, and physics.
A basic familiarity with mathematics is assumed along with some
experience of the basics of computer programs.
The first chapter reviews the basic areas that C can be used in. A
more detailed introduction to C is contained in my Numerical C book.
The chapters following this C review are grouped into finance
(including regression, CAPM, and asset pricing), commercial
applications (supermarket stock control, airport flight information, and
power plant control), and various physics applications. The Graph
package has been used to display the results of programs.
There are exercises in each chapter with answers and suggested
code at the end of the book. The book’s source code can be accessed via
the Download Source Code link located at
www.apress.com/9781484261279 .
Acknowledgments
Thanks to my wife, Anne, for her support, my son Michael, and my
daughter Katharine.
Michael uses regression techniques in his work and has shared
some ideas with me.
Katharine is a software engineer working for a UK bank. All three
have mathematics degrees.
Thanks to everyone on the Apress team who helped me with the
publication of this, my second book. Special thanks to Mark Powers, the
coordinating editor, for his advice; Steve Anglin, the acquisitions editor;
Matthew Moodie, the development editor; and Juturi Narsimha Rao, the
technical reviewer.
Table of Contents
Chapter 1:​Review of C
1.​1 Arithmetic
1.​2 Switches
1.​3 Arrays
1.​4 Strings
1.​5 Mathematical Functions
1.​6 User-Written Functions
1.​7 File Creation
1.​8 File Read
1.​9 File Create2
1.​10 File Read2
1.​11 Common Mathematical and Logical Symbols
Part I: Finance Applications
Chapter 2:​Regression
2.​1 Capital Asset Pricing Model
2.​2 CAPM Illustration
Chapter 3:​PMCC
3.​1 Theory
3.​2 Manual Calculation of PMCC
3.​3 PMCC Program
3.​4 Comparison of the Two Regression Lines
3.​5 Manual Calculation of the Two Regression Lines
3.​6 Program for the Two Regression Lines
Chapter 4:​Stock Price Prediction
4.​1 Two Parts to Stock Price Changes
4.​2 Drift Part of Formula
4.​3 Simple Example with 5 Day’s Prices
4.​4 Random Change Part of Formula
4.​5 Combining the Two Elements
Part II: Commercial Applications
Chapter 5:​Supermarket Stock
5.​1 What We Are Simulating
5.​2 Updating the File
Chapter 6:​Flight Information
6.​1 Airport Display Boards
6.​2 Create Flights File
6.​3 Update Display Boards
6.​3.​1 Not-Rollup Mechanism
6.​3.​2 Rollup Mechanism
Chapter 7:​Power Plant Control
7.​1 Simulation
7.​2 Monitoring Safety Levels
Part III: Physics Applications
Chapter 8:​Energy Transfer
8.​1 Potential and Kinetic Energy Simulation
8.​2 Convert Theory to Code
Chapter 9:​Pendulum Simulation
9.​1 Pendulum Theory
9.​2 Euler Method
9.​3 Euler-Cromer Method
Chapter 10:​Center of Mass
10.​1 Center of Mass Theory
10.​2 Circular Plate
10.​3 Other Shapes
Chapter 11:​Brownian Motion
11.​1 Brownian Motion Theory
Chapter 12:​Diffusion Lattice Model
12.​1 Vacancy Lattice Diffusion
Chapter 13:​Chain Reaction
13.​1 Chain Reaction Theory
13.​2 Chain Reaction Program
Appendix:​Answers to Problems
Index
About the Author
Philip Joyce
has 28 years of experience as a software engineer – working on control
of steel production, control of oil refineries, communications software
(pre-Internet), office products (server software), and computer control
of airports. This involved programming in Assembler, COBOL, Coral66,
C, and C++. Philip was a mentor to new graduates in the company. He
also has MSc in computational physics (including augmented matrix
techniques and Monte Carlo techniques using Fortran) from Salford
University, 1996. Philip is a chartered physicist and member of the
Institute of Physics (member of the higher education group). His first
book, Numerical C, was published by Apress in September 2019.
About the Technical Reviewer
Juturi Narsimha Rao
has 9 years of experience as a software developer, lead engineer, project
engineer, and individual contributor. His current focus is on advanced
supply chain planning between the manufacturing industries and
vendors.
© Philip Joyce 2020
P. Joyce, Practical Numerical C Programming
https://doi.org/10.1007/978-1-4842-6128-6_1

1. Review of C
Philip Joyce1
(1) Goostrey, UK

This chapter reviews the properties of the C programming language.


Example programs are given to illustrate the different areas that C
covers, for example, for, while, do-while loops, user-defined functions,
switches, mathematical functions, file access, and so on.
The programs tend to bring together similar properties, for
example, mathematical functions, and incorporate them as single
programs. The reader can just use the part of these programs that they
need for their program.

1.1 Arithmetic
This program starts with the basic process of asking the user to enter
some data. Here, we will use the term “in the location c” to mean “in the
address of the variable c in the local stack space.”
Firstly, it uses the printf command to write to the user’s
command line to say “Enter character”. When the user types in a
character, the getchar function reads it and places it into the location
c. It then tells the user the character they have entered, firstly using
printf to say “Character entered” and then putchar with c as the
parameter to write the contents of c to the command line. In this case
the location c is a character location denoted by char.
If we want to read integers rather than characters, we define the
location where it is to be stored as int. In this case we call the int
this_is_a_number1. Here, we use the more widely used command
scanf to read in the integer. We specify this_is_a_number1 as a
parameter to the call, and as a first parameter, we specify %d to say that
it is an integer.
We can repeat this with another variable this_is_a_number2.
We can now add these two variables using the coding total=
this_is_a_number1+ this_is_a_number2 where total has to
be defined as an integer. Again, we can use the printf function to
display our answer from total.
We can do similar things with floating point numbers. We define
them as float rather than int. We can subtract numbers using –
rather than +. Similarly, we can multiply using * and divide using /.
The following is the code for our arithmetic calculations:

/* ch1arith.c */
/* Read, display, and arithmetic */
/* Read input data from the command line */
/* and read it into the program. */
/* Also write the data back to the */
/* command line. Basic arithmetic */
/* done on input data. */
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
int main ()
{
char c; /* Declared character variable */
int this_is_a_number1, this_is_a_number2,
total; /* Declared integer variables */
float float_number1,
float_number2,float_total; /* Declared float
variables*/

/* Read and display a character */

printf("Enter character: "); /* Tell the


user to enter a character */
c = getchar(); /* Read the character in and
store in c */

printf("Character entered: "); /* Tell the


user what was entered */
putchar(c); /* Write the char into variable
c */

/* Read in two integers, add them, and display the


answer */

printf("\nPlease enter an integer number:\n


");
scanf("%d", &this_is_a_number1); /* Read
number into this_is_a_number1 */
printf("You entered %d\n",
this_is_a_number1);

printf("Please enter another integer number:


\n");
scanf("%d", &this_is_a_number2); /* Read
number into this_is_a_number2 */
printf("You entered %d\n",
this_is_a_number2);

total = this_is_a_number1 +
this_is_a_number2; /* Add two numbers store in
total */
printf("sum of your two integer numbers is
%d\n", total); /* Write result to command line */

/* Add two floating point numbers */

printf("Please enter a decimal number:\n ");


scanf("%f", &float_number1); /* Read decimal
number into float_number1 */
printf("You entered %f\n", float_number1);
printf("Please enter another decimal number:
\n");
scanf("%f", & float_number2); /*Read decimal
number into float_number2 */
printf("You entered %f\n", float_number2);

float_total = float_number1+float_number2;
/* Add the numbers */
printf("sum of your two decimal numbers is
%f\n", float_total); /* Write result to command
line */

/* Multiply two floating point numbers */

float_total = float_number1 * float_number2;


/* Multiply the numbers */
printf("product of your two decimal numbers
is %f\n", float_total); /* Write result to command
line */

/* Divide two floating point numbers */

/* Divide the numbers */


/* Place answer into float_total */

float_total = float_number1 /
float_number2);

/* Write result to command line */

printf("quotient of your two decimal numbers


is %f\n", float_total) ;
return 0;
}

1.2 Switches
A switch statement is a multiway branch statement. A program can
perform separate different functions. In order to select which one is
required, the program asks the user to select a value, for example, 1 to
use the cosine function, 2 to use the sine function, and so on. The
program then uses this number in the switch command to jump to the
relevant code.
This sequence of code is shown as follows:

printf("\nPlease enter a character a,b,c,d or e:\n


");
scanf("%c", &this_is_a_character);/* read into
this_is_a_character */

switch (this_is_a_character)
{
case 'a':
printf("Case1: Value is: %c\n",
this_is_a_character);
break;

We can switch on numbers or characters. So, for example, we could


ask the user to enter a number from 1 to 5 or a letter from a to e. For
characters we read their value using scanf with %c as a parameter. In
the program, if you select a, then the switch jumps to case a in the
code. In the code here, we print out the fact that we have jumped to
case a, but this is only to demonstrate how it works. After the relevant
code in case a, the program issues a break which jumps to the end of
the switch options.
If the user is asked to type a to e but they type in f, then the switch
goes to the default case. Here, we can just output an error message to
the user.
The following code demonstrates switches:

/* ch1sw.c */
/* Demonstrate switch case functionality by using
switch case */
/* parameter choice as either characters or
numbers */
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

/* Example of a switch operation */


int main()
{
int this_is_a_number; /* Store area to hold
number entered */
char this_is_a_character; /* Store area to hold
character entered */

printf("\nPlease enter a character a,b,c,d or


e:\n ");
scanf("%c", &this_is_a_character); /* Read into
this_is_a_character */

/* Switch to the specific "case" for the


character entered */
/* then print which switch case was entered */
switch (this_is_a_character)
{

case 'a':
printf("Case1: Value is: %c\n",
this_is_a_character);
break;
case 'b':
printf("Case2: Value is: %c\n",
this_is_a_character);
break;
case 'c':
printf("Case3: Value is: %c\n",
this_is_a_character);
break;
case 'd':
printf("Case4: Value is: %c\n",
this_is_a_character);
break;
case 'e':
printf("Case5: Value is: %c",
this_is_a_character);
break;
default:
/* The character entered was not
between a, b, c, d, or e */
printf("Error Value is: %c\n",
this_is_a_character);
}

printf("Please enter an integer between 1


and 5:\n ");
scanf("%d", &this_is_a_number);

/* Switch to the specific "case" for the


number entered */
/* then print which switch case was
entered */
switch (this_is_a_number)
{

case 1:
printf("Case1: Value is: %d\n",
this_is_a_number);
break;
case 2:
printf("Case2: Value is: %d\n",
this_is_a_number) ;
break;
case 3:
printf("Case3: Value is: %d\n",
this_is_a_number);
break;
case 4:
printf("Case4: Value is: %d\n",
this_is_a_number);
break;
case 5:
printf("Case5: Value is: %d\n",
this_is_a_number);
break;
default:
/* The number entered was not
between 1 and 5 */
printf("Error Value is: %d",
this_is_a_number);
}

return 0;
}

1.3 Arrays
As well as defining storage locations as single int, char, or float, we
can have a number of separate values contained in the same named
location. The locations are called arrays. The following program shows
an array of 8 integers defined as int arr1[8] where arr1 is the
name we use in our program for this location.
We could now store 8 integers, for example, 53614673 in the array.
So here, arr1[0] contains 5, arr1[1] contains 3, arr1[2] contains
6, and so on. Note that we count from 0.
We can, as before, ask the user to enter data, but rather than have 8
sets of printf and scanf commands, we can use a forloop, where
we tell the program to perform the same instructions 8 times. We use
the storage location i to move from arr1[0] to arr1[1] and so on,
and we also use the i location to keep count of how many times to go
round the loop. In the for instruction for(i=0;i<8;i++), the i=0
part sets the count i to 0, the i++ adds 1 each time we loop, and i<8
limits the number of times to 8 (note again that we count from 0).
We can also have 2D arrays which are a bit like 2D matrices. We can
define an array as arr2[3][5] so we could store the matrix. The

matrix has 3 rows and 5 columns.

in our array as arr2[0][0] = 2 arr2[0][1] = 3


arr2[0][2] = 6 arr2[0][3] = 5 arr2[0][4]=10
arr2[1][0] = 4 arr2[1][1] = 12 arr2[1][2] = 7
arr2[1][3] = 8 arr2[1][4]=11
arr2[2][0] = 9 arr2[2][1] = 0 arr2[2][2] = 12
arr2[2][3] = 13 arr2[2][4]=14

Note, again, that we count from 0.


The program asks you to enter the 2D matrix. If you enter a 3x5
matrix, you can enter the data here. The program prints your array at
the end.
The code is shown as follows:

/* ch1arr.c */
/* Array use and nested forloops */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

/* Program to show array use */

int main()
{
int arr1[8]; /* Define an array of 8 integers
*/

int arr2[3][5]; /* 2D array of integers 3 rows


and 5 columns*/

int i, j, k, l;

/* arr1 1D array */
/* Ask the user to enter the data */
printf("enter 8 integer numbers\n");

for (i = 0;i < 8;i++)


{
/* Read the data into array arr1 */
scanf("%d", &arr1[i]); /* Read into
arr1[i] */
}
printf("Your 8 numbers are \n");

for (i = 0;i < 8;i++)


{
printf("%d ", arr1[i]); /* Write contents
of arr1 to command line */
}
printf("\n");

/* arr2 2D array */

/* Ask the user to enter the data */


printf("enter number of rows and columns (max 3
rows max 5 columns) \n");
scanf("%d %d", &k, &l);
if (k > 3 || l > 5)
{
/* User tried to enter more than 3 rows
or 5 columns */
printf("error - max of 8 for rows or
columns\n");

else
{
printf("enter array\n");
/* Read i rows and j columns using nested
forloop */
for (i = 0;i < k;i++)
{
for (j = 0;j < l;j++)
{
/* Read the data into array
arr2 */
scanf("%d", &arr2[i][j]);
}
}
printf("Your array is \n");
/* Print entered 2D array using nested
forloop */
for (i = 0;i < k;i++)
{
for (j = 0;j < l;j++)
{
printf("%d ", arr2[i][j]);
}
printf("\n");

}
}

1.4 Strings
The next program shows the use of string manipulation. Strings are
char arrays in the program. Our array “select” is preset with values ‘s’ ‘e’
‘l’ ‘e’ ‘c’ ‘t’ '\0'. This is preset this way to show how the characters are
stored. We would normally define it as char select[7] = “select”;. The
second and third arrays are string1 and string2 and preset as shown.
Our first function is strlen which just returns the length of the string
you have entered. Here, it returns the length of int data point called len.
We can then print this to the user using printf.
The second string function copies one string into the other. So here,
we say strcpy(string3,string1) copies the contents of string1 into
string3. Again, we can print this out using printf.
Our next function, strcmp, compares two strings. If they are the
same, it replies 0.
Our final function concatenates one string onto the end of the other.
So here, it concatenates string2 onto string1 giving “This is string1. This
is string2”.
The code is as follows:

/* ch1strings.c */
/* Demonstrate strings */

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
/* Program to demonstrate string operations
strlen, strcpy, strcat, strcmp */

int main() {
char select[7] = { 's', 'e', 'l', 'e', 'c',
't','\0' };
char string1[32] = "This is string1";
char string2[16] = "This is string2";
char string3[16];

int len;

/* Print out the lengths of the strings */


/* strlen returns length of string */
len = strlen(string1);
printf("strlen(string1) : %d\n", len);
len = strlen(string2);
printf("strlen(string2) : %d\n", len);
len = strlen(string3);
printf("strlen(string3) : %d\n", len);

/* copy string1 into string3 */


/* strcpy copies string1 into string3 */

strcpy(string3, string1);
printf("strcpy( string3, string1) : %s\n",
string3);
len = strlen(string3);
printf("strlen(string3) after copy of
string1 into string3 : %d\n", len);

/* strcmp compares strings & returns 0 if


they are equal */
/* strcmp returns negative value if they are
not equal */
/* Compare string1 and string3 (these should
be the same)*/

if (strcmp(string1, string3) == 0)
printf("strings are the same\n");

/* Concatenates string1 and string2 */

strcat(string1, string2);
printf("strcat( string1, string2): %s\n",
string1);

/* Total length of string1 after


concatenation */
len = strlen(string1);
printf("strlen(string1) after cat of string2
onto string1 : %d\n", len);
printf("String as predefined quoted chars:
%s\n", select);

return 0;
}

1.5 Mathematical Functions


The commonly used mathematical functions are available for you to call
from your program. You need to include the library file <math.h> in
your program to access these. The first three functions are cos, sin,
and tan. Here, you are expected to enter the angle in degrees, but you
can change the code if you want so that you can enter the angle in
radians. The next three are arccos, arcsin, and arctan. Again,
these functions will return the angle in degrees, but again you can
change this to radians.
The next three functions are pow, sqrt, and fabs. The pow
function finds the power of a number. Its first parameter is the number
you want to find the power of and the second parameter is the power
you want to use. The functions return to answer to the store location
answer which is defined as a double float. The function sqrt finds
the square root of the number you enter as its parameter. Again, it
returns the answer into answer. The final function is fabs . You
supply a number as the parameter and it returns the absolute value of
the number.
The code is as follows:

/* ch1math.c */
/* Demonstrate mathematics functions */
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

#include <math.h>
#define PI 3.14159265
/* Illustration of the common trigonometric
functions */
/* also exponent, natural log, log to base 10 */
/* power, square root, and find absolute value */

int main()
{

double angle, radianno, answer;

double arccos, arcsin, arctan;


double expno, natlog, lb10;
double pownum, power, sqroot, fabsno;

/* The cosine function */

printf("cosine function:\n ");


printf("Please enter angle in degrees:\n
");
scanf("%lf", &angle);
printf("You entered %lf\n", angle);
radianno = angle * (2 * PI / 360);
answer = cos(radianno); /* returns cos
value to answer */
printf("cos of %lf is %lf\n", angle,
answer);

/* The sine function */

printf("sine function:\n ");


printf("Please enter angle in degrees:\n
");
scanf("%lf", &angle);
printf("You entered %lf\n", angle);
radianno = angle * (2 * PI / 360);
answer = sin(radianno); /* Returns sin
value to answer */
printf("sin of %lf is %lf\n", angle,
answer);
/* The tangent function */

printf("tangent function:\n ");


printf("Please enter angle in degrees:\n
");
scanf("%lf", &angle);
printf("You entered %lf\n", angle);
radianno = angle * (2 * PI / 360);
answer = tan(radianno); /* Returns tan
value to answer */
printf("tan of %lf is %lf\n", angle,
answer);

/* The arccos function */

printf("arccos function:\n ");


printf("Please enter arccos:\n ");
scanf("%lf", &arccos);
printf("You entered %lf\n", arccos);
radianno = acos(arccos); /* Returns arccos
value to radianno (in radians) */
answer = radianno * (360 / (2 * PI));
printf("arccos of %lf in degrees is %lf\n",
arccos, answer);

/* The arcsin function */

printf("arcsin function:\n ");


printf("Please enter arcsin:\n ");
scanf("%lf", &arcsin);
printf("You entered %lf\n", arcsin);
radianno = asin(arcsin); /* Returns arcsin
value to radianno (in radians) */

answer = radianno * (360 / (2 * PI));


printf("arcsin of %lf in degrees is %lf\n",
arcsin, answer);
/* The arctan function */

printf("arctan function:\n ");


printf("Please enter arctan:\n ");
scanf("%lf", &arctan);
printf("You entered %lf\n", arctan);
radianno = atan(arctan); /* Returns arctan
value to radianno (in radians) */
answer = radianno * (360 / (2 * PI));
printf("arctan of %lf in degrees is %lf\n",
arctan, answer);

/* Showing use of exp, log, and log10


functions */
/* Find exponent of entered number */

printf("exponential function:\n ");


printf("Please enter number:\n ");
scanf("%lf", &expno);
printf("You entered %lf\n", expno);

answer = exp(expno);/* returns exponent


value to answer */
printf("exponent of %lf is %lf\n", expno,
answer);

/* Find natural logarithm of entered number


*/

printf("natural logarithm function:\n ");


printf("Please enter number:\n ");
scanf("%lf", &natlog);
printf("You entered %lf\n", natlog);
answer = log(natlog); /* Returns natural
log value to answer */
printf("natural logarithm of %lf is %lf\n",
natlog, answer);
/* find log to base 10 of entered number */

printf("log to base 10 function:\n ");


printf("Please enter number:\n ");
scanf("%lf", &lb10);
printf("You entered %lf\n", lb10);
answer = log10(lb10); /* Returns log to
base 10 value to answer */

printf("log to base 10 of %lf is %lf\n",


lb10, answer);

/* Showing use of pow, sqrt, and fabs


functions */
/* Find x raised to power y number */

printf("power:\n ");
printf("Please enter number:\n ");
scanf("%lf", &pownum);
printf("You entered %lf\n", pownum);
printf("Please enter power:\n ");
scanf("%lf", &power);
printf("You entered %lf\n", power);

answer = pow(pownum, power); /* Returns


power of pownum value to answer */
printf("%lf raised to power %lf is %lf\n",
pownum, power, answer);

/* Find square root of number */

printf("square root:\n ");


printf("Please enter number:\n ");
scanf("%lf", &sqroot);
printf("You entered %lf\n", sqroot);

answer = sqrt(sqroot); /* returns square


root of sqroot value to answer */
Discovering Diverse Content Through
Random Scribd Documents
“gives me the tongue of instruction, so as to know in season when it
is requisite to speak a word;”[1118] not in the way of testimony alone,
but also in the way of question and answer. “And the instruction of
the Lord opens my mouth.”[1119] It is the prerogative of the Gnostic,
then, to know how to make use of speech, and when, and how, and
to whom. And already the apostle, by saying, “After the rudiments of
the world, and not after Christ,”[1120] makes the asseveration that the
Hellenic teaching is elementary, and that of Christ perfect, as we
have already intimated before.
“Now the wild olive is inserted into the fatness of the olive,”[1121]
and is indeed of the same species as the cultivated olives. For the
graft uses as soil the tree in which it is engrafted. Now all the plants
sprouted forth simultaneously in consequence of the divine order.
Wherefore also, though the wild olive be wild, it crowns the Olympic
victors. And the elm teaches the vine to be fruitful, by leading it up to
a height. Now we see that wild trees attract more nutriment, because
they cannot ripen. The wild trees, therefore, have less power of
secretion than those that are cultivated. And the cause of their
wildness is the want of the power of secretion. The engrafted olive
accordingly receives more nutriment from its growing in the wild one;
and it gets accustomed, as it were, to secrete the nutriment,
becoming thus assimilated[1122] to the fatness of the cultivated tree.
So also the philosopher, resembling the wild olive, in having much
that is undigested, on account of his devotion to the search, his
propensity to follow, and his eagerness to seize the fatness of the
truth; if he get besides the divine power, through faith, by being
transplanted into the good and mild knowledge, like the wild olive,
engrafted in the truly fair and merciful Word, he both assimilates the
nutriment that is supplied, and becomes a fair and good olive tree.
For engrafting makes worthless shoots noble, and compels the
barren to be fruitful by the art of culture and by gnostic skill.

Different modes of engrafting illustrative of different kinds of


conversion.
They say that engrafting is effected in four modes: one, that in
which the graft must be fitted in between the wood and the bark;
resembling the way in which we instruct plain people belonging to
the Gentiles, who receive the word superficially. Another is, when the
wood is cleft, and there is inserted in it the cultivated branch. And
this applies to the case of those who have studied philosophy; for on
cutting through their dogmas, the acknowledgment of the truth is
produced in them. So also in the case of the Jews, by opening up
the Old Testament, the new and noble plant of the olive is inserted.
The third mode of engrafting applies to rustics and heretics, who are
brought by force to the truth. For after smoothing off both suckers
with a sharp pruning-hook, till the pith is laid bare, but not wounded,
they are bound together. And the fourth is that form of engrafting
called budding. For a bud (eye) is cut out of a trunk of a good sort, a
circle being drawn round in the bark along with it, of the size of the
palm. Then the trunk is stripped, to suit the eye, over an equal
circumference. And so the graft is inserted, tied round, and daubed
with clay, the bud being kept uninjured and unstained. This is the
style of gnostic teaching, which is capable of looking into things
themselves. This mode is, in truth, of most service in the case of
cultivated trees. And “the engrafting into the good olive” mentioned
by the apostle, may be [engrafting into] Christ Himself; the
uncultivated and unbelieving nature being transplanted into Christ—
that is, in the case of those who believe in Christ. But it is better [to
understand it] of the engrafting[1123] of each one’s faith in the soul
itself. For also the Holy Spirit is thus somehow transplanted by
distribution, according to the circumscribed capacity of each one, but
without being circumscribed.

Knowledge and love.


Now, discoursing on knowledge, Solomon speaks thus: “For
wisdom is resplendent and fadeless, and is easily beheld by those
who love her. She is beforehand in making herself known to those
who desire her. He that rises early for her shall not toil wearily. For to
think about her is the perfection of good sense. And he that keeps
vigils for her shall quickly be relieved of anxiety. For she goes about,
herself seeking those worthy of her (for knowledge belongs not to
all); and in all ways she benignly shows herself to them.”[1124] Now
the paths are the conduct of life, and the variety that exists in the
covenants. Presently he adds: “And in every thought she meets
them,”[1125] being variously contemplated, that is, by all discipline.
Then he subjoins, adducing love, which perfects by syllogistic
reasoning and true propositions, drawing thus a most convincing and
true inference, “For the beginning of her is the truest desire of
instruction,” that is, of knowledge; “prudence is the love of
instruction, and love is the keeping of its laws; and attention to its
laws is the confirmation of immortality; and immortality causes
nearness to God. The desire of wisdom leads, then, to the
kingdom.”[1126]
For he teaches, as I think, that true instruction is desire for
knowledge; and the practical exercise of instruction produces love of
knowledge. And love is the keeping of the commandments which
lead to knowledge. And the keeping of them is the establishment of
the commandments, from which immortality results. “And immortality
brings us near to God.”

True knowledge found in the teaching of Christ alone.


If, then, the love of knowledge produces immortality, and leads the
kingly man near to God the King, knowledge ought to be sought till it
is found. Now seeking is an effort at grasping, and finds the subject
by means of certain signs. And discovery is the end and cessation of
inquiry, which has now its object in its grasp. And this is knowledge.
And this discovery, properly so called, is knowledge, which is the
apprehension of the object of search. And they say that a proof is
either the antecedent, or the coincident, or the consequent. The
discovery, then, of what is sought respecting God, is the teaching
through the Son; and the proof of our Saviour being the very Son of
God is the prophecies which preceded His coming, announcing Him;
and the testimonies regarding Him which attended His birth in the
world; in addition, His powers proclaimed and openly shown after His
ascension.
The proof of the truth being with us, is the fact of the Son of God
Himself having taught us. For if in every inquiry these universals are
found, a person and a subject, that which is truly the truth is shown
to be in our hands alone. For the Son of God is the person of the
truth which is exhibited; and the subject is the power of faith, which
prevails over the opposition of every one whatever, and the assault
of the whole world.
But since this is confessedly established by eternal facts and
reasons, and each one who thinks that there is no Providence has
already been seen to deserve punishment and not contradiction, and
is truly an atheist, it is our aim to discover what doing, and in what
manner living, we shall reach the knowledge of the sovereign God,
and how, honouring the Divinity, we may become authors of our own
salvation. Knowing and learning, not from the Sophists, but from God
Himself, what is well-pleasing to Him, we endeavour to do what is
just and holy. Now it is well-pleasing to Him that we should be saved;
and salvation is effected through both well-doing and knowledge, of
both of which the Lord is the teacher.
If, then, according to Plato, it is only possible to learn the truth
either from God or from the progeny of God, with reason we,
selecting testimonies from the divine oracles, boast of learning the
truth by the Son of God, prophesied at first, and then explained.

Philosophy and heresies, aids in discovering the truth.


But the things which co-operate in the discovery of truth are not to
be rejected. Philosophy, accordingly, which proclaims a Providence,
and the recompense of a life of felicity, and the punishment, on the
other hand, of a life of misery, teaches theology comprehensively;
but it does not preserve accuracy and particular points; for neither
respecting the Son of God, nor respecting the economy of
Providence, does it treat similarly with us; for it did not know the
worship of God.
Wherefore also the heresies of the Barbarian philosophy, although
they speak of one God, though they sing the praises of Christ, speak
without accuracy, not in accordance with truth; for they discover
another God, and receive Christ not as the prophecies deliver. But
their false dogmas, while they oppose the conduct that is according
to the truth, are against us. For instance, Paul circumcised Timothy
because of the Jews who believed, in order that those who had
received their training from the law might not revolt from the faith
through his breaking such points of the law as were understood
more carnally, knowing right well that circumcision does not justify;
for he professed that “all things were for all” by conformity,
preserving those of the dogmas that were essential, “that he might
gain all.”[1127] And Daniel, under the king of the Persians, wore “the
chain,”[1128] though he despised not the affliction of the people.
The liars, then, in reality are not those who for the sake of the
scheme of salvation conform, nor those who err in minute points, but
those who are wrong in essentials, and reject the Lord, and as far as
in them lies deprive the Lord of the true teaching; who do not quote
or deliver the Scriptures in a manner worthy of God and of the Lord;
for the deposit rendered to God, according to the teaching of the
Lord by His apostles, is the understanding and the practice of the
godly tradition. “And what ye hear in the ear”—that is, in a hidden
manner, and in a mystery (for such things are figuratively said to be
spoken in the ear)—“proclaim,” He says, “on the house-tops,”
understanding them sublimely, and delivering them in a lofty strain,
and according to the canon of the truth explaining the Scriptures; for
neither prophecy nor the Saviour Himself announced the divine
mysteries simply so as to be easily apprehended by all and sundry,
but expressed them in parables. The apostles accordingly say of the
Lord, that “He spake all things in parables, and without a parable
spake He nothing unto them;”[1129] and if “all things were made by
Him, and without Him was not anything made that was made,”[1130]
consequently also prophecy and the law were by Him, and were
spoken by Him in parables. “But all things are right,” says the
Scripture,[1131] “before those who understand,” that is, those who
receive and observe, according to the ecclesiastical rule, the
exposition of the Scriptures explained by Him; and the ecclesiastical
rule is the concord and harmony of the law and the prophets in the
covenant delivered at the coming of the Lord. Knowledge is then
followed by practical wisdom, and practical wisdom by self-control:
for it may be said that practical wisdom is divine knowledge, and
exists in those who are deified; but that self-control is mortal, and
subsists in those who philosophize, and are not yet wise. But if virtue
is divine, so is also the knowledge of it; while self-control is a sort of
imperfect wisdom which aspires after wisdom, and exerts itself
laboriously, and is not contemplative. As certainly righteousness,
being human, is, as being a common thing, subordinate to holiness,
which subsists through the divine righteousness;[1132] for the
righteousness of the perfect man does not rest on civil contracts, or
on the prohibition of law, but flows from his own spontaneous action
and his love to God.

Reasons for the meaning of Scripture being veiled.


For many reasons, then, the Scriptures hide the sense. First, that
we may become inquisitive, and be ever on the watch for the
discovery of the words of salvation. Then it was not suitable for all to
understand, so that they might not receive harm in consequence of
taking in another sense the things declared for salvation by the Holy
Spirit. Wherefore the holy mysteries of the prophecies are veiled in
the parables—preserved for chosen men, selected to knowledge in
consequence of their faith; for the style of the Scriptures is parabolic.
Wherefore also the Lord, who was not of the world, came as one
who was of the world to men. For He was clothed with all virtue; and
it was His aim to lead man, the foster-child of the world, up to the
objects of intellect, and to the most essential truths by knowledge,
from one world to another.
Wherefore also He employed metaphorical description; for such is
the parable,—a narration based on some subject which is not the
principal subject, but similar to the principal subject, and leading him
who understands to what is the true and principal thing; or, as some
say, a mode of speech presenting with vigour, by means of other
circumstances, what is the principal subject.
And now also the whole economy which prophesied of the Lord
appears indeed a parable to those who know not the truth, when one
speaks and the rest hear that the Son of God—of Him who made the
universe—assumed flesh, and was conceived in the virgin’s womb
(as His material body was produced), and subsequently, as was the
case, suffered and rose again, being “to the Jews a stumbling-block,
and to the Greeks foolishness,” as the apostle says.
But on the Scriptures being opened up, and declaring the truth to
those who have ears, they proclaim the very suffering endured by
the flesh, which the Lord assumed, to be “the power and wisdom of
God.” And finally, the parabolic style of Scripture being of the
greatest antiquity, as we have shown, abounded most, as was to be
expected, in the prophets, in order that the Holy Spirit might show
that the philosophers among the Greeks, and the wise men among
the Barbarians besides, were ignorant of the future coming of the
Lord, and of the mystic teaching that was to be delivered by Him.
Rightly then, prophecy, in proclaiming the Lord, in order not to seem
to some to blaspheme while speaking what was beyond the ideas of
the multitude, embodied its declarations in expressions capable of
leading to other conceptions. Now all the prophets who foretold the
Lord’s coming, and the holy mysteries accompanying it, were
persecuted and killed. As also the Lord Himself, in explaining the
Scriptures to them, and His disciples who preached the word like
Him, and subsequently to His life used parables.[1133] Whence also
Peter, in his Preaching, speaking of the apostles, says: “But we,
unrolling the books of the prophets which we possess, who name
Jesus Christ, partly in parables, partly in enigmas, partly expressly
and in so many words, find His coming and death, and cross, and all
the rest of the tortures which the Jews inflicted on Him, and His
resurrection and assumption to heaven previous to the capture[1134]
of Jerusalem. As it is written, These things are all that He behoved to
suffer, and what should be after Him. Recognising them, therefore,
we have believed in God in consequence of what is written
respecting Him.”
And after a little again he draws the inference that the Scriptures
owed their origin to the divine providence, asserting as follows: “For
we know that God enjoined these things, and we say nothing apart
from the Scriptures.”
Now the Hebrew dialect, like all the rest, has certain properties,
consisting in a mode of speech which exhibits the national character.
Dialect is accordingly defined as a style of speech produced by the
national character. But prophecy is not marked by those dialects. For
in the Hellenic writings, what are called changes of figures purposely
produce obscurations, deduced after the style of our prophecies. But
this is effected through the voluntary departure from direct speech
which takes place in metrical or offhand diction. A figure, then, is a
form of speech transferred from what is literal to what is not literal,
for the sake of the composition, and on account of a diction useful in
speech.
But prophecy does not employ figurative forms in the expressions
for the sake of beauty of diction. But from the fact that truth
appertains not to all, it is veiled in manifold ways, causing the light to
arise only on those who are initiated into knowledge, who seek the
truth through love. The proverb, according to the Barbarian
philosophy, is called a mode of prophecy, and the parable is so
called, and the enigma in addition. Further also, they are called
“wisdom;” and again, as something different from it, “instruction and
words of prudence,” and “turnings of words,” and “true
righteousness;” and again, “teaching to direct judgment,” and
“subtlety to the simple,” which is the result of training, “and
perception and thought,” with which the young catechumen is
imbued.[1135] “He who hears these prophets, being wise, will be
wiser. And the intelligent man will acquire rule, and will understand a
parable and a dark saying, the words and enigmas of the wise.”[1136]
And if it was the case that the Hellenic dialects received their
appellation from Hellen, the son of Zeus, surnamed Deucalion, from
the chronology which we have already exhibited, it is comparatively
easy to perceive by how many generations the dialects that obtained
among the Greeks are posterior to the language of the Hebrews.
But as the work advances, we shall in each section, noting the
figures of speech mentioned above by the prophet,[1137] exhibit the
gnostic mode of life, showing it systematically according to the rule
of the truth.
Did not the Power also, that appeared to Hermas in the Vision, in
the form of the Church, give for transcription the book which she
wished to be made known to the elect? And this, he says, he
transcribed to the letter, without finding how to complete the
syllables. And this signified that the Scripture is clear to all, when
taken according to the bare reading; and that this is the faith which
occupies the place of the rudiments. Wherefore also the figurative
expression is employed, “reading according to the letter;” while we
understand that the gnostic unfolding of the Scriptures, when faith
has already reached an advanced state, is likened to reading
according to the syllables.
Further, Esaias the prophet is ordered to take “a new book, and
write in it”[1138] certain things: the Spirit prophesying that through the
exposition of the Scriptures there would come afterwards the sacred
knowledge, which at that period was still unwritten, because not yet
known. For it was spoken from the beginning to those only who
understand. Now that the Saviour has taught the apostles, the
unwritten rendering of the written [Scripture] has been handed down
also to us, inscribed by the power of God on hearts new, according
to the renovation of the book. Thus those of highest repute among
the Greeks, dedicate the fruit of the pomegranate to Hermes, who
they say is speech, on account of its interpretation. For speech
conceals much. Rightly, therefore, Jesus the son of Nave saw
Moses, when taken up [to heaven], double,—one Moses with the
angels, and one on the mountains, honoured with burial in their
ravines. And Jesus saw this spectacle below, being elevated by the
Spirit, along also with Caleb. But both do not see similarly. But the
one descended with greater speed, as if the weight he carried was
great; while the other, on descending after him, subsequently related
the glory which he beheld, being able to perceive more than the
other, as having grown purer; the narrative, in my opinion, showing
that knowledge is not the privilege of all. Since some look at the
body of the Scriptures, the expressions and the names as to the
body of Moses; while others see through to the thoughts and what is
signified by the names, seeking the Moses that is with the angels.
Many also of those who called to the Lord said, “Son of David,
have mercy on me.”[1139] A few, too, knew Him as the Son of God;
as Peter, whom also He pronounced blessed, “for flesh and blood
revealed not the truth to him, but His Father in heaven,”[1140]—
showing that the Gnostic recognises the Son of the Omnipotent, not
by His flesh conceived in the womb, but by the Father’s own power.
That it is therefore not only to those who read simply that the
acquisition of the truth is so difficult, but that not even to those whose
prerogative the knowledge of the truth is, is the contemplation of it
vouchsafed all at once, the history of Moses teaches, until,
accustomed to gaze, as the Hebrews on the glory of Moses, and the
prophets of Israel on the visions of angels, so we also become able
to look the splendours of truth in the face.
CHAPTER XVI.
GNOSTIC EXPOSITION OF THE DECALOGUE.

Let the Decalogue be set forth cursorily by us as a specimen for


gnostic exposition.

The number “Ten.”


That ten is a sacred number, it is superfluous to say now. And if
the tables that were written were the work of God, they will be found
to exhibit physical creation. For by the “finger of God” is understood
the power of God, by which the creation of heaven and earth is
accomplished; of both of which the tables will be understood to be
symbols. For the writing and handiwork of God put on the table is the
creation of the world.
And the Decalogue, viewed as an image of heaven, embraces
sun and moon, stars, clouds, light, wind, water, air, darkness, fire.
This is the physical Decalogue of the heaven.
And the representation of the earth contains men, cattle, reptiles,
wild beasts; and of the inhabitants of the water, fishes and whales;
and again, of the winged tribes, those that are carnivorous, and
those that use mild food; and of plants likewise, both fruit-bearing
and barren. This is the physical Decalogue of the earth.
And the ark which held them[1141] will then be the knowledge of
divine and human things and wisdom.[1142]
And perhaps the two tables themselves may be the prophecy of
the two covenants. They were accordingly mystically renewed, as
ignorance along with sin abounded. The commandments are written,
then, doubly, as appears, for twofold spirits, the ruling and the
subject. “For the flesh lusteth against the Spirit, and the Spirit against
the flesh.”[1143]
And there is a ten in man himself: the five senses, and the power
of speech, and that of reproduction; and the eighth is the spiritual
principle communicated at his creation; and the ninth the ruling
faculty of the soul; and tenth, there is the distinctive characteristic of
the Holy Spirit, which comes to him through faith.
Besides, in addition to these ten human parts, the law appears to
give its injunctions[1144] to sight, and hearing, and smell, and touch,
and taste, and to the organs subservient to these, which are double
—the hands and the feet. For such is the formation of man. And the
soul is introduced, and previous to it the ruling faculty, by which we
reason, not produced in procreation; so that without it there is made
up the number ten, of the faculties by which all the activity of man is
carried out. For in order, straightway on man’s entering existence,
his life begins with sensations. We accordingly assert that rational
and ruling power is the cause of the constitution of the living
creature; also that this, the irrational part, is animated, and is a part
of it. Now the vital force, in which is comprehended the power of
nutrition and growth, and generally of motion, is assigned to the
carnal spirit, which has great susceptibility of motion, and passes in
all directions through the senses and the rest of the body, and
through the body is the primary subject of sensations. But the power
of choice, in which investigation, and study, and knowledge, reside,
belongs to the ruling faculty. But all the faculties are placed in
relation to one—the ruling faculty: it is through that man lives, and
lives in a certain way.
Through the corporeal spirit, then, man perceives, desires,
rejoices, is angry, is nourished, grows. It is by it, too, that thoughts
and conceptions advance to actions. And when it masters the
desires, the ruling faculty reigns.
The commandment, then, “Thou shalt not lust,” says, thou shalt
not serve the carnal spirit, but shalt rule over it; “for the flesh lusteth
against the Spirit,”[1145] and excites to disorderly conduct against
nature; “and the Spirit against the flesh” exercises sway, in order that
the conduct of the man may be according to nature.
Is not man, then, rightly said “to have been made in the image of
God?”—not in the form of his [corporeal] structure; but inasmuch as
God creates all things by the Word (λόγῳ), and the man who has
become a Gnostic performs good actions by the faculty of reason
(τῷ λογικῷ), properly therefore the two tables are also said to mean
the commandments that were given to the twofold spirits,—those
communicated before the law to that which was created, and to the
ruling faculty; and the movements of the senses are both copied in
the mind, and manifested in the activity which proceeds from the
body. For apprehension results from both combined. Again, as
sensation is related to the world of sense, so is thought to that of
intellect. And actions are twofold—those of thought, those of act.

The First Commandment.


The first commandment of the Decalogue shows that there is one
only Sovereign God;[1146] who led the people from the land of Egypt
through the desert to their fatherland; that they might apprehend His
power, as they were able, by means of the divine works, and
withdraw from the idolatry of created things, putting all their hope in
the true God.

The Second Commandment.


The second word[1147] intimated that men ought not to take and
confer the august power of God (which is the name, for this alone
were many even yet capable of learning), and transfer His title to
things created and vain, which human artificers have made, among
which “He that is” is not ranked. For in His uncreated identity, “He
that is” is absolutely alone.

The Fourth Commandment.


And the fourth[1148] word is that which intimates that the world
was created by God, and that He gave us the seventh day as a rest,
on account of the trouble that there is in life. For God is incapable of
weariness, and suffering, and want. But we who bear flesh need
rest. The seventh day, therefore, is proclaimed a rest—abstraction
from ills—preparing for the Primal Day,[1149] our true rest; which, in
truth, is the first creation of light, in which all things are viewed and
possessed. From this day the first wisdom and knowledge illuminate
us. For the light of truth—a light true, casting no shadow, is the Spirit
of God indivisibly divided to all, who are sanctified by faith, holding
the place of a luminary, in order to the knowledge of real existences.
By following Him, therefore, through our whole life, we become
impassible; and this is to rest.
Wherefore Solomon also says, that before heaven, and earth, and
all existences, Wisdom had arisen in the Almighty; the participation
of which—that which is by power, I mean, not that by essence—
teaches a man to know by apprehension things divine and human.
Having reached this point, we must mention these things by the way;
since the discourse has turned on the seventh and the eighth. For
the eighth may possibly turn out to be properly the seventh, and the
seventh manifestly the sixth, and the latter properly the Sabbath, and
the seventh a day of work. For the creation of the world was
concluded in six days. For the motion of the sun from solstice to
solstice is completed in six months—in the course of which, at one
time the leaves fall, and at another plants bud and seeds come to
maturity. And they say that the embryo is perfected exactly in the
sixth month, that is, in one hundred and eighty days in addition to the
two and a half, as Polybus the physician relates in his book On the
Eighth Month, and Aristotle the philosopher in his book On Nature.
Hence the Pythagoreans, as I think, reckon six the perfect number,
from the creation of the world, according to the prophet, and call it
Meseuthys[1150] and Marriage, from its being the middle of the even
numbers, that is, of ten and two. For it is manifestly at an equal
distance from both.
And as marriage generates from male and female, so six is
generated from the odd number three, which is called the masculine
number, and the even number two, which is considered the feminine.
For twice three are six.
Such, again, is the number of the most general motions,
according to which all origination takes place—up, down, to the right,
to the left, forward, backward. Rightly, then, they reckon the number
seven motherless and childless, interpreting the Sabbath, and
figuratively expressing the nature of the rest, in which “they neither
marry nor are given in marriage any more.”[1151] For neither by
taking from one number and adding to another of those within ten is
seven produced; nor when added to any number within the ten does
it make up any of them.
And they call eight a cube, counting the fixed sphere along with
the seven revolving ones, by which is produced “the great year,” as a
kind of period of recompense of what has been promised.
Thus the Lord, who ascended the mountain, the fourth,[1152]
becomes the sixth, and is illuminated all round with spiritual light, by
laying bare the power proceeding from Him, as far as those selected
to see were able to behold it, by the Seventh, the Voice, proclaimed
to be the Son of God; in order that they, persuaded respecting Him,
might have rest; while He by His birth, which was indicated by the six
conspicuously marked, becoming the eighth, might appear to be God
in a body of flesh, by displaying His power, being numbered indeed
as a man, but being concealed as to who He was. For six is
reckoned in the order of numbers, but the succession of the letters
acknowledges the character which is not written. In this case, in the
numbers themselves, each unit is preserved in its order up to seven
and eight. But in the number of the characters, Zeta becomes six
and Eta seven.
And the character[1153] having somehow slipped into writing,
should we follow it out thus, the seven became six, and the eight
seven.
Wherefore also man is said to have been made on the sixth day,
who became faithful to Him who is the sign (τῷ ἐπισήμῳ[1154]), so as
straightway to receive the rest of the Lord’s inheritance. Some such
thing also is indicated by the sixth hour in the scheme of salvation, in
which man was perfected. Further, of the eight, the intermediates are
seven; and of the seven, the intervals are shown to be six. For that is
another ground, in which seven glorifies eight, and “the heavens
declare to the heavens the glory of God.”[1155]
The sensible types of these, then, are the sounds we pronounce.
Thus the Lord Himself is called “Alpha and Omega, the beginning
and the end,”[1156] “by whom all things were made, and without
whom not even one thing was made.”[1157] God’s resting is not, then,
as some conceive, that God ceased from doing. For, being good, if
He should ever cease from doing good, then would He cease from
being God, which it is sacrilege even to say. The resting is, therefore,
the ordering that the order of created things should be preserved
inviolate, and that each of the creatures should cease from the
ancient disorder. For the creations on the different days followed in a
most important succession; so that all things brought into existence
might have honour from priority, created together in thought, but not
being of equal worth. Nor was the creation of each signified by the
voice, inasmuch as the creative work is said to have made them at
once. For something must needs have been named first. Wherefore
those things were announced first, from which came those that were
second, all things being originated together from one essence by
one power. For the will of God was one, in one identity. And how
could creation take place in time, seeing time was born along with
the things which exist?
And now the whole world of creatures born alive, and things that
grow, revolves in sevens. The first-born princes of the angels, who
have the greatest power, are seven. The mathematicians also say
that the planets, which perform their course around the earth, are
seven; by which the Chaldeans think that all which concerns mortal
life is effected through sympathy, in consequence of which they also
undertake to tell things respecting the future.
And of the fixed stars, the Pleiades are seven. And the Bears, by
the help of which agriculture and navigation are carried through,
consist of seven stars. And in periods of seven days the moon
undergoes its changes. In the first week she becomes half moon; in
the second, full moon; and in the third, in her wane, again half moon;
and in the fourth she disappears. Further, as Seleucus the
mathematician lays down, she has seven phases. First, from being
invisible she becomes crescent-shaped, then half moon, then
gibbous and full; and in her wane again gibbous, and in like manner
half moon and crescent-shaped.
“On a seven-stringed lyre we shall sing new hymns,”

writes a poet of note, teaching us that the ancient lyre was seven-
toned. The organs of the senses situated on our face are also seven
—two eyes, two passages of hearing, two nostrils, and the seventh
the mouth.
And that the changes in the periods of life take place by sevens,
the Elegies of Solon teach thus:
“The child, while still an infant, in seven years,
Produces and puts forth its fence of teeth;
And when God seven years more completes,
He shows of puberty’s approach the signs;
And in the third, the beard on growing cheek
With down o’erspreads the bloom of changing skin;
And in the fourth septenniad, at his best
In strength, of manliness he shows the signs;
And in the fifth, of marriage, now mature,
And of posterity, the man bethinks;
Nor does he yet desire vain works to see.
The seventh and eighth septenniads see him now
In mind and speech mature, till fifty years;
And in the ninth he still has vigour left,
But strength and body are for virtue great
Less than of yore; when, seven years more, God brings
To end, then not too soon may he submit to die.”

Again, in diseases the seventh day is that of the crisis; and the
fourteenth, in which nature struggles against the causes of the
diseases. And a myriad such instances are adduced by Hermippus
of Berytus, in his book On the Number Seven, regarding it as holy.
And the blessed David delivers clearly to those who know the mystic
account of seven and eight, praising thus: “Our years were exercised
like a spider. The days of our years in them are seventy years; but if
in strength, eighty years. And that will be to reign.”[1158] That, then,
we may be taught that the world was originated, and not suppose
that God made it in time, prophecy adds: “This is the book of the
generation: also of the things in them, when they were created in the
day that God made heaven and earth.”[1159] For the expression
“when they were created” intimates an indefinite and dateless
production. But the expression “in the day that God made,” that is, in
and by which God made “all things,” and “without which not even
one thing was made,” points out the activity exerted by the Son. As
David says, “This is the day which the Lord hath made; let us be glad
and rejoice in it;”[1160] that is, in consequence of the knowledge
imparted by Him, let us celebrate the divine festival; for the Word
that throws light on things hidden, and by whom each created thing
came into life and being, is called day.
And, in fine, the Decalogue, by the letter Iota,[1161] signifies the
blessed name, presenting Jesus, who is the Word.

The Fifth Commandment.


Now the fifth in order is the command on the honour of father and
mother. And it clearly announces God as Father and Lord.
Wherefore also it calls those who know Him sons and gods. The
Creator of the universe is their Lord and Father; and the mother is
not, as some say, the essence from which we sprang, nor, as others
teach, the church, but the divine knowledge and wisdom, as
Solomon says, when he terms wisdom “the mother of the just,” and
says that it is desirable for its own sake. And the knowledge of all,
again, that is lovely and venerable, proceeds from God through the
Son.

The Seventh Commandment.


This is followed by the command respecting adultery. Now it is
adultery, if one, abandoning the ecclesiastical and true knowledge,
and the persuasion respecting God, accedes to false and
incongruous opinion, either by deifying any created object, or by
making an idol of anything that exists not, so as to overstep, or
rather step from, knowledge. And to the Gnostic false opinion is
foreign, as the true belongs to him, and is allied with him. Wherefore
the noble apostle calls one of the kinds of fornication, idolatry,[1162] in
following the prophet, who says: “[My people] hath committed
fornication with stock and stone. They have said to the stock, Thou
art my father; and to the stone, Thou hast begotten me.”[1163]

The Sixth Commandment.


Then follows the command about murder. Now murder is a sure
destruction. He, then, that wishes to extirpate the true doctrine of
God and of immortality, in order to introduce falsehood, alleging
either that the universe is not under Providence, or that the world is
uncreated, or affirming anything against true doctrine, is most
pernicious.

The Eighth Commandment.


And after this is the command respecting theft. As, then, he that
steals what is another’s, doing great wrong, rightly incurs ills suitable
to his deserts; so also does he, who arrogates to himself divine
works by the art of the statuary or the painter, and pronounces
himself to be the maker of animals and plants. Likewise those, too,
who mimic the true philosophy are thieves. Whether one be a
husbandman or the father of a child, he is an agent in depositing
seeds. But it is God who, ministering the growth and perfection of all
things, brings the things produced to what is in accordance with their
nature. But the most, in common also with the philosophers, attribute
growth and changes to the stars as the primary cause, robbing the
Father of the universe, as far as in them lies, of His tireless might.
The elements, however, and the stars—that is, the administrative
powers—are ordained for the accomplishment of what is essential to
the administration, and are influenced and moved by what is
commanded to them, in the way in which the Word of the Lord leads,
since it is the nature of the divine power to work all things secretly.
He, accordingly, who alleges that he has conceived or made
anything which pertains to creation, will suffer the punishment of his
impious audacity.

The Tenth Commandment.


And the tenth is the command respecting all lusts. As, then, he
who entertains unbecoming desires is called to account; in the same
way he is not allowed to desire things false, or to suppose that, of
created objects, those that are animate have power of themselves,
and that inanimate things can at all save or hurt. And should one say
that an antidote cannot heal or hemlock kill, he is unwittingly
deceived. For none of these operates except one makes use of the
plant and the drug; just as the axe does not without one to cut with it,
or a saw without one sawing with it. And as they do not work by
themselves, but have certain physical qualities which accomplish
their proper work by the exertion of the artisan; so also, by the
universal providence of God, through the medium of secondary
causes, the operative power is propagated in succession to
individual objects.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like