POV-Ray : Newsgroups : povray.general : unexpected rotation result : Re: unexpected rotation result Server Time
8 Aug 2024 16:20:30 EDT (-0400)
  Re: unexpected rotation result  
From: Warp
Date: 7 Feb 2001 12:23:25
Message: <3a81848c@news.povray.org>
Tom Melly <tom### [at] tomandlucouk> wrote:
: I disagree - for example I am not offended/shocked/suprised/whatever that
: entering 2+3*5 in a calculator gives me 25

  If I enter that in my calculator it gives me 17.
  Why?

  There are two (main) types of calculators.
  Usually calculators only calculate one operation at a time. They do not
have memory for long expressions (some of these have indeed parentheses,
but still they work in the same way when parentheses are not used) and they
calculate every sub-expression right after it has been entered.
  What happens when you type "2+3*" (yes, I left the '5' intentionally out)
is the following: The calculator gets a '2', then a '+', then a '3'. Now
it expects either a number or another key (such as '=' or another operator).
When it gets something that is not numerical input it immediately calculates
the result of the current operation (as if '=' had been pressed) before
continuing.
  In fact, pressing any operator is like pressing '=' and that operator
(some very cheap calculators don't even have a '=' at all, but you have to
press some operator in order to get the result, such as '+'). Pressing the
operator is more like a shortcut for '=' and the operator itself.
  This is most probably done for simplicity. Usually these kind of calculators
are used for very simple tasks, like adding the prices of some products
together and so on. Modifying the behaviour of the operator keys to work
in another way would most probably just confuse people.
  When you type "2+4*5" you are, in fact, typing "2=+3=*5", although it's
kind of hidden.

  Now, the most advanced calculators (mainly graphical ones, like mine) allow
you to actually write long expressions (the whole expression is shown on
the screen of the calculator) and the result is calculated only when you
press '=' (or usually 'enter' in those calculators).
  These calculators also usually allow you to navigate through the expression
with cursor keys and make modifications to it.
  (The most advanced allow you to enter more complex mathematical operations
such as summation, derivative and integrals. Mine does; it even shows them
in the same way as I would write them on paper.)
  Since in these calculators you are actually calculating the result of the
whole expression, not just a sub-expression at a time, the result is the
mathematically expected one.

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.