Table Of ContentBORLAND PASCAL’
PROGRAMS ror
SCIENTISTS & ENGINEERS
Alan R. Miller
_ ge. at
Run Compile Debug Tools Options Window Help
LIST11.PAS i=[tI=y
ing-point numbers }
MPare e
windows versiont
hange dir...
rae ike
Printer setup...
OS shell
oob eet. §
| Writeln(|
es ee
Creating a New Program
To create a new program, move the mouse pointer to highlight the menu title File.
Press the left mouse button to pull down the menu. Highlight the menu item Open
and press the left mouse button. Type the program name and press Enter.
Preparing an Existing Program for Changes
To open an existing program for changes, move the mouse pointer to highlight the
menu title File. Press the left mouse button to pull down the menu. Highlight the menu
item Open and press the left mouse button. When the dialog box appears, type the name
and press Enter or put the cursor on the name and press the left mouse button twice in
rapid succession to open the file. Now you can make changes to the program.
earch Ta anpile ebug ools ptions indoyw age
ire Alt+BkSp
Ctrl+Ins
‘Oar =t:t s Ctrl+Del
ite( [:5
XM := 6.1 =
Remove the selected text and put it in the Clipboard
Making Block Changes to an Open Program
To change a block of text to an open program, move the mouse pointer to the beginning
of the block and press the left mouse button. Hold the left mouse button and move the
mouse to highlight the block. Then release the button. Highlight the menu item Edit and
press the left mouse button. To delete or move the marked block, select Cut. The marked
block disappears. To copy the block, select Copy. Press the mouse button to unmark
the block. For move or copy, move the mouse pointer to the new location and press the left
button. Highlight the menu item Edit and press the left mouse button. Select Paste to
insert the block. To insert the block to another program, open that program, move the
cursor to the desired place and select Paste.
Acquisitions Editor: David Clark
Developmental Editor: Gary Masters
Copy Editor: Marilyn Smith
Technical Editor: Bob Campbell
Typesetter: The Typesetting Shop, Inc.
Proofreader/Production Assistant: Elisabeth Dahl
Cover Designer: Ingalls + Associates
Cover Photographer: David Bishop
SYBEX is a registered trademark of SYBEX, Inc.
TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary
trademarks from descriptive terms by following the capitalization style used by the manufacturer.
SYBEX is not affiliated with any manufacturer.
Every effort has been made to supply complete and accurate information. However, SYBEX
assumes no responsibility for its use, nor for any infringement of the intellectual property rights of
third parties which would result from such use.
An earlier version of this book was published under the title Turbo Pascal Programs for Scientists and
Engineers copyright ©1987 SYBEX Inc.
Copyright ©1993 SYBEX Inc., 2021 Challenger Drive, Alameda, CA 94501. World rights
reserved. No part of this publication may be stored in a retrieval system, transmitted, or
reproduced in any way, including but not limited to photocopy, photograph, magnetic or other
record, without the prior agreement and written permission of the publisher.
Library of Congress Card Number: 92-83718
ISBN: 0-7821-1150-5
Manufactured in the United States of America
10987654321
Borland Pascal Programs
for Scientists & Engineers
MILLS COLLEGE
LIBRARY
aa Or
SHBEAS
Borland Pascal’ Programs
for Scientists & Engineers
wlSS
SS
Alan R. Miller
C
lawl
San Francisco ¢ Paris e Dusseldorf e London SYBEx®
ae TD ghia. 3 eels,
14
502.%552 lo
P2t%m~p
\AAD
Contents
Introduction xvii
Chapter 1 1
Evaluating the Borland Pascal Compiler
Borland Pascal Compilers |
Precision and Range of Floating-Point Operations 2
‘Testing Floating-Point Operations 3
Comparing the Compilers 4
Other Borland Pascal Functions 5
‘Testing Functions 5
The Arc ‘Tangent Function 7
The Arc Sine and Arc Cosine Functions 8
‘Testing the Arc Sine and Arc Tangent Functions 9
Using External Files 10
Summary 11
Exercises 11
Chapter 2 15
Statistical Tools
The Mean 15
Dispersion from the Mean 16
The Standard Deviation 18
Calculation of the Standard Deviation 19
Calculating the Mean and Standard Deviation 20
Mills College Library
WITHDRAWN
_MILLS COLLEGE
Vill
Random Numbers and Random-Number
Generators 2S
Evaluating the Random-Number Generator 23
Using w to Produce Random Numbers 25
Gaussian Random Numbers 25
A Gaussian Random-Number Generator 26
Summary 28
Exercises 28
Chapter 3 31
Vector and Matrix Operations
Scalars and Arrays ot
Vectors 32
Vector Arithmetic 33
Strings 35
Matrices 36
Matrix Arithmetic 37
Programming Matrix Multiplication 40
Determinants 44
Calculating Determinants 45
Inverse Matrices and Matrix Division 46
Summary 47
Exercises 47
Chapter 4 51
Simultaneous Solution of Linear Equations
Linear Equations and Simultaneous Solutions 52
Solution by Cramer’s Rule 53
Linear Dependence 54
Example: A Direct-Current Electrical Circuit 9