music 
OSdata.com 
fixed point numbers
summary
Representing fixed point numbers in a computer.
free computer programming text book projecttable of contents

music 
OSdata.com 
Representing fixed point numbers in a computer.
free computer programming text book projecttable of contents

This subchapter is a stub section. It will be filled in with instructional material later. For now it serves the purpose of a place holder for the order of instruction.
Professors are invited to give feedback on both the proposed contents and the propsed order of this text book. Send commentary to Milo, PO Box 1361, Tustin, California, 92781, USA.
The following material is from the unclassified Computer Programming Manual for the JOVIAL (J73) Language, RADCTR81143, Final Technical Report of June 1981.
Chapter 1 INTRODUCTION, page 2
ITEM ANGLE A 2,13; A fixed item, whose value is stored
with fixed scaling, namely two bits to
the left of the binary point and
thirteen fractional bits. Thus it
accomodate a value in the range 4 <
value < +4 to a precision of
1/(2**14).
Chapter 1 INTRODUCTION, page 4
Representing fixed point numbers in a computer.
Fixed Decimal declarations:
type of data: coded arithmetic (Binary Coded Decimal, packed two decimal digits to a single 8bit byte)
S/360, S/370 data format: packed decimal
default precision: five (5) decimal digits
maximum precision: 15 decimal digits
example:
DECLARE DOLLAR_AMOUNT FIXED DECIMAL (9,2) INIT (100.00);
First number in declaration is the total number of stored digits. Second number in declaration (optional) is the number of digits to the right of an implied decimal point. If the second number is zero or left out, then the number is an integer.
Fixed decimal is more efficient if the precision is declared as an odd number of digits (because of extra code generated to guarantee that the last half of an even number of decimal digits remains zero). Numbers too large to fit into the specified storage will be truncated. Numbers too small to fill the entire storage space will be zerofilled.
Fixed Binary declarations:
type of data: coded arithmetic (binary )
S/360, S/370 data format: fixed point
default precision: 16 bits
maximum precision: 31 bits
example:
DECLARE LOCAL_DISTANCE FIXED BINARY (31,16) INIT (256.5);
First number in declaration is the total number of stored bits. Second number in declaration (optional) is the number of bits to the right of an implied “decimal” point. If the second number is zero or left out, then the number is an integer.
Generally the fastest execution time for arithmetic. Sizes 16 bits or fewer are stored in two bytes. Sizes 1731 bits are stored in four bytes.
Undeclared variables starting with the letters I through N, inclusive, default to FIXED BINARY (15).
Many decimal fractions have no exact binary equivalent, which may result in a small rounding error.
“31 Every object in the language has a type, which characterizes a set of values and a set of applicable operations. The main classes of types are elementary types (comprising enumeration, numeric, and access types) and composite types (including array and record types).” —:AdaEurope’s Ada Reference Manual: Introduction: Language Summary See legal information
“33 Numeric types provide a means of performing exact or approximate numerical computations. Exact computations use integer types, which denote sets of consecutive integers. Approximate computations use either fixed point types, with absolute bounds on the error, or floating point types, with relative bounds on the error. The numeric types Integer, Float, and Duration are predefined.” —:AdaEurope’s Ada Reference Manual: Introduction: Language Summary See legal information
Coding example: I am making heavily documented and explained open source code for a method to play music for free — almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a frontend to YouTube (which checks the copyright permissions for you).
View music player in action: www.musicinpublic.com/.
Create your own copy from the original source code/ (presented for learning programming).
return to table of contents
free downloadable college text book
Because I no longer have the computer and software to make PDFs, the book is available as an HTML file, which you can convert into a PDF.
previous page  next page 
Tweets by @osdata 
free computer programming text book projectBuilding a free downloadable text book on computer programming for university, college, community college, and high school classes in computer programming. If you like the idea of this project, Supporting the entire project: If you have a business or organization that can support the entire cost of this project, please contact Pr Ntr Kmt (my church) free downloadable college text book on computer programming. 
This web site handcrafted on Macintosh computers using Tom Bender’s TexEdit Plus and served using FreeBSD .
†UNIX used as a generic term unless specifically used as a trademark (such as in the phrase “UNIX certified”). UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd.
Names and logos of various OSs are trademarks of their respective owners.
Copyright © 2010, 2012 Milo
Created: October 31, 2010
Last Updated: September 20, 2012
return to table of contents
free downloadable college text book
previous page  next page 