home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
MATH
/
C.ZIP
/
C.DOC
next >
Wrap
Text File
|
1994-02-13
|
6KB
|
235 lines
****************************
c : the Cool Command-line CalCulator
****************************
F R E E W A R E
by
Tom Wilson
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
I bet you've spent most of last week wondering when you'd
get a chance to use an idiotic program written by a 15 year-old
in his first year of computer science. Well, here it is....
Actually, this program, unlike most of the others I've
written, is fairly useful. I gave it to a whole bunch (6) of my
friends, and most (4) of them said that they used it quite a lot.
Coincidentally, these four happened to be friends that are
smaller and weaker than me. But really, its a neat program.
It's very simple to use. At your DOS prompt, type in <c>,
and press <ENTER>. You'll see a fairly moronic bunch of
characters come on the screen to tell you how its used (I got
this idea for Pkzip; if they can do it, so can I). In a
nutshell, the Cool CalCulator uses neat command-line parameters
to figure out what the hell its supposed to be doing. For
instance, if your computer literate but mathematically challenged
child (brother? sister?) wanted to add four and four, he (she?)
would type:
c 4 + 4
Get the idea? It's real easy. c recognizes 5 operators:
+, -, *, /, and ^. Respectively, these stand for: addition,
subtraction, multiplication, and x to the nth (?). If you're a
complete moron, and put something else in there, it will give you
an error message.
c also uses cool control parameters. These allow you to
control how the results of the operation you used are presented.
By default, c shows you the result round off to the nearest
hundredth. You can tell the program to show you the answer to 5
decimal places, 10 decimal places, rounded to the nearest
integer, and with the decimal value truncated. The control
parameters to do this are as follows:
+L : show answer to 5 decimal places
+E : show answer to 10 decimal places
+R : round answer to nearest whole integer
+T : truncate the decimal value of the answer
For example:
C:\>c 2.9 / 1.9
Result of operation: 1.526
C:\>c 2.9 / 1.9 +L
Result of operation: 1.52632
C:\>c 2.9 / 1.9 +E
Result of operation: 1.5263157895
C:\>c 2.9 / 1.9 +R
Result of operation: 2.000
C:\>c 2.9 / 1.9 +T
Result of operation: 1.000
c allows you to handle so really B I G numbers with relative
ease. It allows input values that are up to 18 digits long, but,
unless you have a numeric coprocessor, these can be a little
quirky. But, as long as you stick to numbers that are, say, 14
digits (I mean, what are you using this program for, the federal
debt?) long, you'll be fine.
What makes this program good is that it is so small. And
its pretty fast. And it uses an almost undetectable amount of
RAM. So all you people who still have 286s with 20 MB harddrives
and 640 K of memory (like my parents), may find this appealing.
Also, it's F R E E! In case you didn't know, that's why I
put that big F R E E W A R E sign at the front of this document.
I would desperately LOVE to charge people for this 'cause I'm
gonna need to go to college sometime in the near future, but I
figure nobody would pay for this stuff. Ah well....
Anyway, I can be contacted on Prodigy (XDKP09E) or
CompuServe(72732,152). If you're on the internet, that's
XDKP09E@prodigy.com. Send me a message. Even better, send me
some money. If you want the next version of this, or want some
other program of mine (some are quite good, actually), then write
me, and either give me some improvements for this program, or
some logical and scientific evidence that shows God exists
(Obviously, I don't need to worry about the latter). If you like
this program, then P L E A S E tell me! Thank you.....
NOTES:
~~~~~
Just a few things to consider-
Some people I originally gave this to said that they
couldn't figure out how to use the ^ function, so I thought I'd
better clear this up. You use ^ to raise the first operand to
the power of the second. So two to the fourth would be
c 2 ^ 4
Get it? By the way, the ^ function does not work with
non-integer numbers on the second operand. So if you enter a
number with a decimal value, c automatically rounds it to the
nearest integer. So:
c 2 ^ 2.6 = c 2 ^ 3
c does not need a numeric coproccessor. Far be it from me
to needlessly shove money to Intel's pocket by requiring users to
have one (you'd go buy one if this program needed it, wouldn't
you? Wouldn't you?!). However, without one, it may make mistakes
when handling REALLY big numbers, like
4762591540092687.47601128372. Okay....?