![]() 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.
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 8-bit 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 zero-filled.
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 17-31 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). :Ada-Europes 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. :Ada-Europes Ada Reference Manual: Introduction: Language Summary See legal information
There is a temporary stoppage in work on this project because the author is once again homeless. This is a very worthy project that can benefit tens of millions of poor students at a very low cost (hundreds of dollars a month) and a banner ad for the sponsor could lead to millions of dollars of income. If a business is interested in supporting this project, please see project for details.
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 |
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, At the time I write this message I am a few days from becoming homeless. That will greatly interfere with my ability to create this project, which can help nearly 20 million U.S. college students and more than 150 million students world-wide. I am looking for 30 rich people or corporations willing to donate $10 a month to my church so that the church can provide a place indoors for me to continue work. If you want to donate, please see help project. Thanks much. 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. |
I do the news as an unpaid volunteer for KOCI 101.5 FM, Newport Beach/Costa Mesa (also available on the web)

This web site handcrafted on Macintosh
computers using Tom Benders Tex-Edit 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 Milo
Created: October 31, 2010
Last Updated: December 11, 2010
return to table of contents
free downloadable college text book
| previous page | next page |