Dec 222017
 
QLIB is a library of subroutines CALL-able from QuickBASIC, providing the QuickBASIC programmer with many additional functions and commands.
File QLIB56.ZIP from The Programmer’s Corner in
Category BASIC Language
QLIB is a library of subroutines CALL-able from QuickBASIC, providing the QuickBASIC programmer with many additional functions and commands.
File Name File Size Zip Size Zip Type
COMPLEX.DOC 4066 1192 deflated
DATA.DOC 48209 11161 deflated
DISK.DOC 28885 6948 deflated
EMS.DOC 6778 1821 deflated
GRAPHICS.DOC 71497 17913 deflated
INPUT.DOC 25099 6419 deflated
INTRO.DOC 46799 12025 deflated
QLIB.BI 5570 1161 deflated
QLIB.LIB 145961 71248 deflated
QXLIB.LIB 146987 71677 deflated
SOLVE.DOC 17209 3813 deflated
SYSTEM.DOC 19360 5278 deflated
TPCREAD.ME 199 165 deflated
UPDATE.DOC 3299 1115 deflated
VIDEO.DOC 44200 10665 deflated

Download File QLIB56.ZIP Here

Contents of the COMPLEX.DOC file



************************* COMPLEX DATA TYPE *******************************

QLIB's COMPLEX data type is modeled after the COMPLEX data type in
PC FORTRAN compilers. COMPLEX data is 8 bytes long, and consists of
paired SINGLE values. The low 4 bytes represent the real part of the
complex value, and the high 4 bytes represent the imaginary part of the
number. For allocating arrays, copying values or several other operations,
you may use BASIC and you should treat COMPLEX data as though it were
DOUBLE. For calculation or data type conversion, use QLIB. QLIB's
COMPLEX subroutines use the 80x87 if present, or use BASIC's 8087 emulator
otherwise. As I have done limited testing with non-8087 equipped computers,
I suggest that you save your work before running any COMPLEX subroutines
from within the QuickBASIC enviornment. Where 80x87 emulation is
indicated, I have had no problems (except for speed!!) running stand-alone
.EXE programs on computers without a math coprocessor.





Subroutine: CPX2Real(cpx#, r!, i!)
Object file: complex.obj

80x87 not required

CPX2Real splits a COMPLEX value into its real and imaginary components.
Note that the components are 4-byte SINGLE data, while the complex value
is 8 bytes long.

Example:
REM cpx# is a complex value computed by QLIB earlier in the program
CALL CPX2Real(cpx#, r!, i!)
PRINT "The real part of cpx# is ", r!
PRINT "The imaginary part of cpx# is ", i!





Function: c3# = CPXAdd#(c0#, c1#)
Object file: complex.obj

80x87 not required; uses BASIC's emulator

CPXAdd add two complex numbers. c0# and c1# must be valid COMPLEX values.

Example:
REM $INCLUDE: 'qlib.bi'
.
.
.
REM the values of c0# and c1# were established earlier in the program
c2# = CPXAdd(c0#, c1#)




Function: c2# = CPXDiv(c0#, c1#)
Object file: complex.obj

80x87 not required; uses BASIC's emulator

CPXDiv divides c0# by c1#, returning the result in c2#. c0# and c1#
must be valid COMPLEX numbers.

Example:
REM $INCLUDE: 'qlib.bi'
.
.
.
REM the values of c0# and c1# were established earlier in the program
c2# = CPXDiv(c0#, c1#)



Function: c2# = CPXMul(c0#, c1#)
Object file: complex.obj

80x87 not required; uses BASIC's emulator

CPXMul multiplies c0# and c1#, returning the product in c2#. c0# and c1#
must be valid COMPLEX numbers.

Example:
REM $INCLUDE: 'qlib.bi'
.
.
.
REM the values of c0# and c1# were established earlier in the program
c2# = CPXMul(c0#, c1#)



Function: c1# = CPXNeg(c0#)
Function: c1# = CPXNegI(c0#)
Function: c1# = CPXNegR(c0#)
Object file: complex.obj

80x87 not required

CPXNeg changes the sign of c0#'s real and imaginary parts. CPXNegI
changes the sign of only the imaginary part of c0#, and CPXNegR changes
the sign of only the real part of c0#. In all cases, c0# is unchanged
and the result is returned in c1#.

Example:
REM $INCLUDE: 'qlib.bi'
.
.
.
c1# = CPXNeg(c0#)





Function: cpx# = Real2CPX(r!, i!)
Object file: complex.obj

80x87 not required

Real2CPX forms a COMPLEX value from the component real and imaginary
parts. Note that r! and i! are 4-byte SINGLE values, and cpx# is 8
bytes long.

Example:
REM $INCLUDE: 'qlib.ib' ' has Real2CPX function declaration
r! = 3.678!: i! = -.0987 ' the number 3.678-.0987i
cpx# = Real2CPX(r!, i!)



 December 22, 2017  Add comments

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)