@DATABASE "Ev.Guide"
@$VER: Ev 1.0 -<Jesper Wilhelmsson>- (001201)
@INDEX "MAIN"
@NODE "MAIN" "Ev - Math tool for its users"

@{B}@{U}@{JCENTER}Ev V1.0@{UU}@{UB}

A replacement for Eval, distributed with Amiga OS.
@{JLEFT}

@{U}@{B}The Usual Menu@{UB}@{UU}

@{" INTRODUCTION        " LINK "Introduction"} - Differences between Ev and Eval
@{" FUNCTIONS           " LINK "Functions"} - Functions implemented
@{" USAGE               " LINK "Usage"} - How to express yourself
@{" BUGS                " LINK "Bugs"} - Nah..!
@{" AUTHOR              " LINK "Author"} - It's me!
@{" FREEWARE!           " LINK "Freeware"} - What else?
@{" HISTORY             " LINK "History"} - What has happened?
@{" COMMERCIAL BREAK    " LINK "Stuff"} - Other software

@ENDNODE

@NODE "Introduction" "Why does this program exist?"

@{B}@{U}@{JCENTER}What is this?@{UB}@{UU}
@{JLEFT}

I have for some time been very unsatisfied with the functions of the tool
eval, included in Amiga OS. I was hoping for an update in Amiga OS 3.5 but
nothing has been done to this tool.
Therefor I have written my own tool for mathematical evaluations.

The worst things about the old eval:

* It can't count! 1+2*3 should equal 7 not 9!! (no priorities?)
* No suport for binary numbers
* No support for decimal numbers
* Too few functions
* Not flexible enough to be userfriendly
* No bugfixes or upgrades are made from the developer

Ev is improved in theese areas and some other:

* The prioritys are correct! 1+2*3 = 7
* Ev supports all the old Eval input for compability reasons
  (except for a few changes)
* Support for binary numbers added in input and output
* The constants pi and e added
* Support for decimal numbers added, both 0.1 and .1 are accepted
* Correct rounding of decimals

* New flexibility added with support for:
  * the words and (&), or (|), not (~)
  * both <<, >> and lsh, rsh (and l, r)
  * d## and %d for decimal input and output
  * *t for tab in output
  * Number of digits in octal and hexadecimal output is optional
  * multiplication without '*'-token in obvious places

* Several new functions:
  * absolute value (abs)
  * square root (sqrt)
  * faculty (!)
  * powered numbers (^)
  * trigonometric functions (sin, cos, tan)
  * random number (rnd)

+ I will keep upgrading it if there is a need for that.

Downside of the new version:

* Bigger executable. I've used the tools bison and flex to create the parser
  and theese tools do not create small files. The executable is now ~30k.

* eqv not implemented yet. I haven't got the full insight in what this function
  really does, is there a c equivalence?

* e does not mean eqv any more since the number e=2.718281828...

* Since I don't have the standard c include files for Amiga OS, I had to
  do all argument handling manually. This seems to have a negative effect
  on the behaviour of Ev in scripts. For example the test script in the
  manual for OS 3.5 with Eval used as a counter will not work with Ev.
  However I did not create Ev to be used as a simple counter.

I hope thats it.

@ENDNODE

@NODE "Functions" "What can it do?"

@{B}@{U}@{JCENTER}Functions suported by Ev@{UB}@{UU}
@{JLEFT}

The four rules of arithmetics, +, -, * and / are of course supported,
and I don't see any point in explaining them any futher.
NOTE that the times sign, '*', can be omitted in the usual cases,
4sin(#) = 4*sin(#), 2pi = 2*pi, 5(4+2) = 5*(4+2) etc.

@{B}and@{UB}    Bitwise and. Can also be written as: &

@{B}or@{UB}     Bitwise or. Can also be written as: |

@{B}xor@{UB}    Bitwise xor. Can also be written as: x

@{B}not@{UB}    Bitwise not. Can also be written as: ~

@{B}lsh@{UB}    Left shift (of bits). Can also be written as: << or l

@{B}rsh@{UB}    Right shift (of bits). Can also be written as: >> or r

@{B}eqv@{UB}    Bitwise equvialence. Not implementet yet. (What is it?)

@{B}mod@{UB}    Modulo. Returns remainder from division.
               Can also be written as: % or m

@{B}^@{UB}      Power.   Eg: 4^2 = 4*4 = 16
                    4^3 = 4*4*4 = 64

@{B}!@{UB}      Faculty. 5! = 1*2*3*4*5 = 120
                n! = 1*2*3*4*...*(n-1)*n

@{B}Sqrt()@{UB} The square root. Sqrt(16) = 4 Because 4*4 = 16
                        Sqrt(25) = 5 (5*5 = 25)

@{B}Abs()@{UB}  Absolute value. Abs(-3) = 3
                       Abs(3) = 3   ie Makes numbers positive.

@{B}Sin()@{UB}  Sine. Well, either you know it or you don't.

@{B}Cos()@{UB}  Cosine.

@{B}Tan()@{UB}  Tangens.

@{B}PI@{UB}     3.1415926536

@{B}e@{UB}      2.71828182845

@{B}rnd@{UB}    A random number between 0 and 1.

Parenthesis, '(' and ')', can be included in the expressions.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

The trigonomethric functions Sin(), Cos() and Tan() reads angles in
radians, NOT degrees. 180° = Pi radians.


@{B}@{U}@{JCENTER}Using different bases@{UB}@{UU}
@{JLEFT}

The most common base in modern mathematics is ten, (probably because
the number of fingers on the avrage human). It is however possible to
use any number as a base.
Ev supports the most common bases two, eight,ten and sixteen, ten is
used by default. To use some of the other bases you use a prefix.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}Binary@{UB}

The base two is used much in lowlevel comuting and digital electronics.
These numbers are called binary numbers and are typed as folows:

b0000 = 0      b0100 = 4       b10011010 = 154
b0001 = 1      b0101 = 5       b00010110 = 22
b0010 = 2      b0110 = 6       b00010101 = 21
b0011 = 3      b0111 = 7       b00101010 = 42

The 'b' is used to tell Ev that it is a binary number. There is no need
to write the zeros before the number, but the most common way to write
binary numbers are in groups of four or eight digits.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}Octal@{UB}

The base eight is allso pretty common in electronics, and the numbers
are called octal numbers. Ev expects you to write octal numbers
with the prefix 'o', '0' or '#':

o5  = 5        027 = 23        #31 = 25
o10 = 8        030 = 24        #52 = 42

As you might have notised there are no digits higher than 7. Octal numbers
can not contain the digits eight or nine. An attempt to write o9 will result
in a parse error.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}Decimal@{UB}

The decimal numbers are used by default, but the prefix 'd' can be used if
you think it looks nice.

The decimal numbers can contain decimals, with a preceding number or without.

Eg: 47.11
     0.42
      .4711

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}Hexadecimal@{UB}

The most used base in the computer world is sixteen. The numbers are
called hexadecimal numbers or just hex for short. If you've looked in to
the memory of your computer you have most likely seen hexadecimal numbers
before.
Ev handles several different prefixes for hex: h, $, 0x and #x

h7  = 7        0xf  = 15
ha  = 10       0x10 = 16
$b  = 11       #x11 = 17
$c  = 12       #x2a = 42

As you can see there are some letters involved here. Allowed letters
are: a, b, c, d, e, f. Since there are only ten figures, one have to use
some letters to be able to express the hexadecimal numbers.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}Characters@{UB}

Ev can also read characters. It will use the ASCII values to calculate
with. The prefix is: '

This means that Ev can be used to find the ASCII value for different
characters:

Ev 'A   -> 65
Ev 'a   -> 97

Unfortunally the argument handling won't let you give a SPACE char as
input, but the ASCII value for SPACE is 32 so now you won't have to.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

All prefixes must be typed BEFORE their number, as showed in the examles
above. It is allowed to mix different bases in the same expression, the
answer will be decimal anyway. If you want to get the answer in binary,
octal or hexadecimal form you can use the appropriate @{"LFORMAT string" LINK "Usage"}.

@ENDNODE

@NODE "Usage" "How do I use this thing?"

@{B}@{U}@{JCENTER}Usage@{UB}@{UU}
@{JLEFT}

@{B}TEMPLATE@{UB}

Ev VALUE1/A,OP,VALUE2/M,TO/K,LFORMAT/K

Just type the expression you want to evaluate, it's as simple as that!

Ev 1+2*3

Will give you the answer: 7

Ev (2(3+5)^2)/2+4
-> 68

You can use parenthesis with all functions, but they are only required
in some special cases.

For instance if you want to calculate 2+3*4 it will give the answer 14.
This might be what you wanted (if you know how to express yourself),
but if you want the answer 20, you have to use parenthesis around 2+3.

Eg: (2+3)*4 or 4(2+3)

Read more about @{"functions" LINK "Functions"} for detailed information
about each function supported.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}VALUE1@{UB}

Can be used to set the first value in the expression.
This value will always be first in the expression and the rest of the
expression will be concatenated onto this value.

Mostly usable in scripts.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}OP@{UB}

Can be used to set the operator in the expression.
This operator will be concatenated onto the rest of the expression and
will result in an parse error if the VALUE2 field is left empty.

Mostly usable in scripts.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}VALUE2@{UB}

Can be used to set the last value in the expression.
This value will always be concatenated last onto the expression.

Mostly usable in scripts.

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}TO@{UB}

You can redirect the output to a file with the keyword TO <file>:

Ev 42 TO Work:File

@{B}@{JCENTER}-----------------------------------@{UB}
@{JLEFT}

@{B}LFORMAT@{UB}

All ansvers is by default in decimal form. You can however use a format string
to design your output.

Ev 6*7 LFORMAT="The answer is %d.*n"

Will give the result: The answer is 42.

The %d will insert the decimal value in the string. There are some other codes
for this output string:

%b<value> Convert to binary format. <value> is the number of bits to display.
%o[<n>] Octal format.
%d[<n>] or %n[<n>] Decimal format
%h[<n>] or %x[<n>] Hexadecimal format
%c Display the character vith corresponding ASCII value.

*n Insert newline
*t Insert tab

Eg: Ev 42 lformat="%b8 %o %d %x %c*n"

 -> 00101010 52 42 2a *

Octal and hexadecimal values may have the optional value n to determine
the number of digits to display.

Decimal values may have the optional value n to determine the number of
decimals to display.

NOTE: Decimal numbers will be rounded correctly if the selected number of
      decimals are lower than the existing number.

Eg: Ev 100.09 LFORMAT="%d1"  -> 100.1

    Ev 100.99 LFORMAT="%d1"  -> 101.0

    Ev 99.9 LFORMAT="%d0"    -> 100


NOTE: When using a LFORMAT-string no newline character will be added to the
      string. You will have to add this yourself with *n if you want it.

@ENDNODE

@NODE "Bugs" "Any bugs?"

@{B}@{U}@{JCENTER}Bug reports@{UB}@{UU}
@{JLEFT}

Well, if I knew about the bugs I would fix them, not release the program.
I am not Micro$oft.

But I'm only human and the code is big so the program probably contains
several strange lifeforms...
                            ...Please let me know!


@{B}@{U}@{JCENTER}Disclaimer@{UB}@{UU}
@{JLEFT}

If this program gets strange input (non mathematical things), it might
behave strange, (who wouldn't). But strange input will probably give
parse error, and it is most unlikely that it crashes your computer.
Please try!

If you do manage to destroy anything with this software I will not
feel responsible in any way.

@ENDNODE

@NODE "Author" "Hey! I wrote this!"

This program was written by:

@{B}
          Jesper Wilhelmsson
          jive@algonet.se
@{UB}

Please let me know what you think about it!

On my web page you can find tons of source codes in several diferent
languages. Test programs, Games, compilers and an operating system
among other things.

There are also a lot of help texts for programmers.
All in swedish though...

          http://welcome.to/syntaxerror

@ENDNODE

@NODE "Freeware" "Copy, copy, copy!!!"

@{B}@{U}@{JCENTER}This program is FreeWare!@{UB}@{UU}
@{JLEFT}

This means that you can spread it freely in what forms you may please.

The one restriction is that no one is alowed to make any money out of it!
It is strictly forbidden to pay any money to anyone in order to get a copy.
(Including the author, I don't want any money - I just want eMail!)

@ENDNODE

@NODE "History" "How has this evolved?"

@{B}@{U}@{JCENTER}History@{UB}@{UU}
@{JLEFT}

v1.0 (2000-01-13)

     First release.


@ENDNODE

@NODE "Stuff" "Other great products"

@{B}@{U}@{JCENTER}(: Other stuff made by me :)@{UB}@{UU}

@{U}@{B}W R I G G L E  v1.5@{UB}@{UU}

It is almost the standard worm-game except for
the controls.  You control  the  worm with the
mouse, which can be tricky at first, but after
a few rounds you'll  se the advantages  with a
'non square  worm'.  Move  freely  around  the
board  and pick up boxes.  There is, ofcourse,
no danger involved  in crossing your own tail.
Have you  ever  seen  a worm  that  dies  just
because he stumbles on his own tail?          

Can be found at Aminet:  game/misc/Wriggle.lha



@{U}@{B}Char Counter@{UB}@{UU}

Finds the n:th character in a file and display
it together with its suroundings.  Nice when a
compiler  or something  tells you  there is an
error at character 3125 in a file.            

Can be found at my homepage, including source:
http://welcome.to/syntaxerror                 



@{U}@{B}S n o O o w !  v1.1@{UB}@{UU}

Configurable  Snoowy window  on your  Worbench
You can change the size  and  possition of the
window, the number of snowflakes and the wind.

Can be found at Aminet:    game/gag/SnoOow.lha
Source code is to be foud at my homepage.     

@ENDNODE
