包含在查找更多文档专项支持资源 | 以 PDF 格式下载本书 (2592 KB)
Chapter 8 CalculatorThe DeskSet Calculator is a scientific and financial calculator designed to perform a variety of mathematical functions. It operates in much the same way as many hand-held calculators. There are financial, logical, and scientific modes. You can store numbers in ten different memory registers and retrieve and replace them easily. In addition, you can store up to 10 of your own functions and constants in menus. The Calculator displays numbers in fixed-point notation and decimal base, but you can change it to display numbers in engineering or scientific notation, and in binary, octal, or hexadecimal base. This chapter describes how to use the Calculator. You can use Calculator with a mouse, as you do other OpenWindows applications, or without a mouse, as you would a physical hand-held calculator. With the mouse, you click SELECT on the Calculator buttons; otherwise, you use the keyboard. To open the Calculator application, choose Workspace -> Programs Calculator. Calculator Icon and Base WindowThe Calculator icon and base window are shown in Figure 8-1. The base window has six rows of eight buttons. Click SELECT on a button to activate it. Figure 8-1 Calculator Icon and Base Window
The Calculator base window is resizable by using the resize corners (it might take a few seconds to redisplay when it's resized). Modes of OperationThe Calculator has various modes of operation. The area below the window header displays the current number, followed by a mode line that displays the current mode settings. Numeric BasesYou can set the numeric bases to Binary, Octal, Decimal, or Hexadecimal using the Base key pop-up menu, as shown in Figure 8-2. Press MENU on the Base key to display the menu. Figure 8-2 Numeric Base Pop-up Menu
The current base setting is shown as the first item in the mode line. In Figure 8-2, "DEC" indicates Decimal base. Up to 40 digits can be entered for each number, regardless of the base. If you need to enter a larger or smaller number, use the Exp key as discussed under "Number Manipulation Functions". The numeric keypad changes to display only those numbers appropriate to the current base mode. Inappropriate numbers are dimmed out. For example, in Figure 8-2 the hexadecimal letter keys (A-F) are dimmed. The numeric base in that figure is decimal, so the hexadecimal letters are not valid or accessible.
Figure 8-3 shows the keypads for both Binary and Hexadecimal numeric bases. Figure 8-3 The Binary Keypad and Hexadecimal Keypad![]()
Display NotationYou can choose to display Calculator results in Fixed point, Engineering, or Scientific notation by using the Disp (Display) key menu shown in Figure 8-4. Press MENU on the Disp key to display the menu. Figure 8-4 Display Type Pop-up Menu for Display Notation Mode
The current display notation is displayed as the third item in the mode line. In Figure 8-4, the mode line shows FIX, indicating Fixed Point notation. When the current display notation is Engineering, ENG appears on the mode line. When the current notation is Scientific, SCI is displayed. When the current notation is Fixed Point, the Calculator will revert to Scientific notation if a number is larger than the display will allow. Major Calculator ModesThere are four major Calculator modes that determine the available functions:
You can choose these four modes using the Mode pop-up menu shown in Figure 8-5. Press MENU on the Mode key to display the menu. The default mode is Basic mode, which uses the standard keys on the Calculator window. The other three modes have extra buttons that appear in a pop-up window. For information on these modes, see "Financial Functions", "Logical Functions", and "Scientific Functions". Figure 8-5 Mode Pop-up Menu
Figure 8-6 The Mode Menu
The current major mode is displayed on the mode line underneath and slightly to the left of the number display. In Figure 8-5, BASIC is listed as the current mode. Number Manipulation FunctionsThe Calculator has 12 number manipulation functions, as shown in Figure 8-7. Figure 8-7 Number Manipulation Functions
Miscellaneous FunctionsThe Calculator has five miscellaneous functions, shown in Figure 8-8. Figure 8-8 Miscellaneous Functions
Memory RegistersThe Calculator has 10 memory registers that you can access using the keys shown in Figure 8-9. Figure 8-9 Memory Register Keys
To display the Exch, Sto, and Rcl pop-up menus, press MENU on the buttons. User-Defined FunctionsThe Calculator allows you to enter your own set of constants and to define your own functions through the Con and Fun keys shown in Figure 8-10. Figure 8-10 User-defined Function Keys
Each of these keys has a menu associated with it, which you display by pressing MENU on the key. Choosing the first item from the menu displays a window that lets you enter the value of a constant or a function, and associate a name with that value. The numbers you enter are stored in a .calctoolrc file in your home directory. Once you have entered the new value, the new value and its name are displayed in the pop-up menu associated with that Calculator key. To use the constant or function value, choose the desired item from the pop-up menu. Performing Simple CalculationsCalculations are performed from left to right, with no arithmetic precedence. For example, 2+3*4=20. You need parentheses, available on the Calculator base window, to establish correct arithmetic precedence. For example, 2+(3*4)=14. To perform a numerical operation, such as adding two numbers together:
Creating and Saving a FunctionNote that when you enter a value for a new function, you must type the keyboard equivalents in the Value field. To display the keyboard equivalents for each Calculator key, click SELECT on the Keys button. The following example describes how to create and save a function that adds together two numbers taken from memory registers, and stores the result in another memory register.
Financial FunctionsThe Calculator has the financial functions shown in Figure 8-11. Choose Financial from the Mode key pop-up menu to display the Financial Mode window. Figure 8-11 Financial Functions
The financial functions retrieve needed information from the memory registers. For example, in order to determine the amount of an installment payment, the Calculator needs to know the amount of the loan, the interest rate, and the term of the loan. You must store this information in the appropriate registers before you click SELECT on the financial function button. See "Memory Registers"to learn how to store numbers in the registers. The following function descriptions include information about what the Calculator expects to find in each register for each function, plus examples of how to use each fu*nction. Ctrm: Compounding TermUse Ctrm to compute the number of compounding periods it will take an investment of present value to grow to a future value, earning a fixed interest rate per compounding period. Store the following numbers in the memory registers:
Ctrm Example:You have just deposited $8,000 in an account that pays an annual interest rate of 9%, compounded monthly. You want to determine how long it will take to double you investment. Register 0: 0.01 (interest rate = 9% / 12) Register 1: 16000 (future value) Register 2: 8000 (present value) Clicking SELECT on Ctrm returns 92.77, which tells you that it would take 92.77 months, or almost eight years, to double your $8,000. Ddb: Double-Declining DepreciationUse Ddb to compute the depreciation allowance on an asset for a specified period of time, using the double-declining balance method. Store the following information in the memory registers:
Ddb Example:You have purchased an office machine for $8,000. The useful life of this machine is six years. The salvage value after six years is $900. You want to compute the depreciate expense for the fourth year, using the double-declining balance method. Memory register usage: Register 0: 8000 (amount paid for asset) Register 1: 900 (value of asset at end of its life) Register 2: 6 (useful life of the asset) Register 3: 4 (time period for depreciation allowance) Clicking SELECT on Ddb returns 790.12, which tells you that the depreciation expense for the fourth year will be $790.12. Fv: Future ValueUse Fv to determine the future value of an investment. The Calculator computes the future value based on a series of equal payments, earning a periodic interest rate over the number of payment periods in a term. The memory registers need to contain the following numbers:
Fv Example:You plan to deposit $4,000 each year for the next 20 years into a bank account. The account is paying 8% interest, compounded annually. Interest is paid on the last day of each year. You want to compute the value of your account in 20 years. You make each year's contribution on the last day of the year. Memory register usage: Register 0: 4000 (periodic payment) Register 1: 0.08 (periodic interest rate is 8%) Register 2: 20 (number of periods) Clicking SELECT on Fv returns 183047.86, the value of your account in dollars at the end of 20 years. Pmt: Periodic PaymentUse Pmt to compute the amount of the periodic payment of a loan. Most installment loans are computed like ordinary annuities, in that payments are made at the end of each payment period. Store the following information in the memory registers:
Pmt Example:You are considering taking out a $120,000 mortgage for 30 years at an annual interest rate of 11.0%. You want to determine your monthly repayment. Memory register usage: Register 0: 120000 (principal). Register 1: 0.00916 (periodic interest rate is 11.0% / 12) Register 2: 360 (term - 30 x 12) Clicking SELECT on Pmt returns 1142.06, the value in dollars of your monthly repayment. Pv: Present ValueUse Pv to determine the present value of an investment. The Calculator computes the present value based on a series of equal payments discounted at a periodic interest rate over the number of periods in the term. The following information is retrieved from the memory registers:
Pv Example:You have just won a million dollars. The prize is awarded in 20 annual payments of $50,000 each (a total of $1,000,000 over 20 years). Annual payments are received at the end of each year. You are given the option of receiving a single lump-sum payment of $400,000 instead of the million dollars annuity. You want to find out which option is worth more in today's dollars. If you were to accept the annual payments of $50,000, you assume that you would invest the money at a rate of 9%, compounded annually. Memory register usage: Register 0: 50000 (periodic payment). Register 1: 0.09 (periodic interest rate is 9%) Register 2: 20 (term) Clicking SELECT on Pv returns a value of 456427.28, which tells you that the $1,000,000 paid over 20 years is worth $456,427 in present dollars. Based on your assumptions, the lump-sum payment of $400,000 is worth less than the million-dollar ordinary annuity, in present dollars (before taxes). Rate: Periodic Interest RateUse Rate to compute the periodic interest rate. It returns the periodic interest necessary for a present value to grow to a future value over the specified number of compounding periods in the term. Store the following information in the memory registers:
Rate Example:You have invested $20,000 in a bond. The bond matures in five years and has a maturity value of $30,000. Interest is compounded monthly. You want to determine the periodic interest rate for this investment. Note - Before entering the information into the memory registers, choose 5 radix places from the Acc (accuracy) key pop-up menu to produce more accurate results. Memory register usage: Register 0: 30000 (future value) Register 1: 20000 (present value) Register 2: 60 (term - 5 x 12) Clicking SELECT on Rate returns.00678, which tells you that the periodic (monthly) interest rate is 0.678%, under 1% per month. To determine the annual rate, multiply the above formula by 12, which yields a result of 8.14%. Sln: Straight-line DepreciationUse Sln to compute the straight-line depreciation of an asset for one period. The straight-line method of depreciation divides the depreciable cost (actual cost minus salvage value) evenly over the useful life of an asset. The useful life is the number of periods, typically years, over which an asset is depreciated. Use the memory registers to store the following information:
Sln Example:You have purchased an office machine for $8,000. The useful life of this machine is six years, and the salvage value in eight years will be $900. You want to compute yearly depreciation expense, using the straight-line method. Memory register usage: Register 0: 8000 (cost of the asset) Register 1: 900 (salvage value of the asset) Register 2: 6 (useful life of the asset) Clicking SELECT on Sln returns 1183.33, the yearly dollar depreciation allowance. Syd: Sum-of-the-years'-digits DepreciationUse Syd to compute the sum-of-the-years'-digits depreciation. This method of depreciation accelerates the rate of depreciation so that more depreciation expense occurs in earlier periods than in later ones. The depreciable cost is the actual cost minus salvage value. The useful life is the number of periods, typically years, over which an asset is depreciated. Store the following information in the memory registers:
Syd Example:You have just purchased an office machine for $8,000. The useful life of this machine is six years, and the salvage value after eight years will be $900. You want to compute the depreciation expense for the fourth year, using the sum-of-the-years'-digits method. Memory register usage: Register 0: 8000 (cost of the asset) Register 1: 900 (salvage value of the asset) Register 2: 6 (useful life of the asset) Register 3: 4 (period for which depreciation is computed) Clicking SELECT on Syd returns 1014.29, the dollar depreciation allowance for the fourth year. Term: Payment PeriodUse Term to compute the number of payment periods in the term of an ordinary annuity necessary to accumulate a future value earning a specified periodic interest rate. Store the following information in the memory registers:
Term Example:You deposit $1,800 at the end of each year into a bank account. Your account earns 11% a year, compounded annually. You want to determine how long it will take to accumulate $120,000. Memory register usage: Register 0 - 1800 (periodic payment) Register 1 - 120000 (future value) Register 2 - 0.11 (periodic interest rate is 11%) Clicking SELECT on Term returns 20.32, the number of years it will take to accumulate $120,000 in your account. Logical FunctionsThe Calculator has the logical functions shown in Figure 8-12. This pop-up window is displayed when you choose Logical from the Mode key pop-up menu. Figure 8-12 Logical Functions
Scientific FunctionsThe Calculator has the scientific functions shown in Figure 8-13. This window is displayed when you choose Scientific from the Mode key pop-up menu. Figure 8-13 Scientific Functions
Click SELECT on the Set Default button to make your Appearance, Base, Mode, Display, Accuracy, Contents, Functions, and Style settings the default every time you start a new Calculator. Calculator Function KeysEvery function in the Calculator application has a keyboard equivalent associated with it. Table 8-1 lists each Calculator function with its keyboard equivalent. See the manual page for calctool for a more complete description of each function. The manual page for calctool also lists Calculator command line options and various resources that can be set in your .Xdefaults or .desksetdefaults files. Keyboard equivalents listed in brackets indicate a choice of options. For example, the keyboard equivalent for the Disp function is D [e, f, s]. This means that you can enter De, Df, or Ds. Similarly, the Exch function keyboard equivalent is F [0-9], which means you can enter F0, F1, F2, etc. through F9. Table 8-1 Calculator Function Keyboard Equivalents
Customizing Your CalculatorUse the Calculator Properties window to customize the look and layout of your Calculator. To display the Properties window, place the pointer anywhere in the Calculator application: Press MENU, Choose Properties from the Calculator pop-up menu, and release MENU. The Properties window is shown in Figure 8-14. Figure 8-14 Calculator Properties Window
Figure 8-15 Right-hand Layout of Calculator Display
Click SELECT on the Save as Defaults button to make your Appearance, Base, Mode, Display, Accuracy, Contents, Functions, and Style settings the default every time you start a new Calculator. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||