Quoting "Rafael R. Sevilla" <[EMAIL PROTECTED]>:

> The way it works is you enter the number, press EXE, then the
> Bin/Oct/Dec/Hex buttons will convert the displayed result appropriately.

Thanks for the tip.

> even then, we run into syntactic difficulties, i.e., how do you *enter*
> fractions?  We can't very well use the / because it's already used for
> division.  If you have any ideas on how we can do this, we'll see if we
> can incorporate it...

Easy.  Create a  "[a b/c]" key, a "[d/c]", which are the keys
already available on most scientific calculators.  To enter

356 & 23 / 5027   just press  "356 [a b/c] 23 [a b/c] 5027".

Operations on fractions use the normal keys +, -, *, /, ^.
Answers are given as mixed numbers in lowest terms in the form

356 _/ 23 _/ 5027

Pressing the [d/c] key converts the answer from mixed number to improper
fraction.

Even five digits for numerator and denominator is GOOD enough.
You do not even have to work from scratch, since there is a 
Rational C++ class in libstdc++ which you can simplify and adapt for
this purpose.

When fractions and reals are mixed in an expression, most calculators
convert to real and carry out the mixed operation in real.

This feature is useful for high school students who are expected
to write answers in simplified fraction form.

O kelan ba natin matatapos ito?  Ang kulit ano?

PMana


--------
This mail sent through IMP: mail.ateneo.net

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to