Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39416

Re: "Adhoc?" RPN mathparser using strings instead of stack.

Newsgroups comp.lang.javascript
Date 2021-01-31 12:52 -0800
References (1 earlier) <c1689bdb-18d4-4f17-a9a4-616cd0520b3fn@googlegroups.com> <dfd0886f-88b0-4262-aa2c-9f2e74ba8b11n@googlegroups.com> <ot1d1g5r62q77ialrr2efa0li8236j8paa@4ax.com> <23969f7e-aa27-4364-b3f2-d51c3394a8f2n@googlegroups.com> <grtd1gdl5m1hu3390fmpvp90vnfvl1hlcq@4ax.com>
Message-ID <cd3c45e3-0bed-4e95-a7e9-6ea0f6e78eebn@googlegroups.com> (permalink)
Subject Re: "Adhoc?" RPN mathparser using strings instead of stack.
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


söndag 31 januari 2021 kl. 19:32:39 UTC+1 skrev John G Harris:
> On Sun, 31 Jan 2021 05:09:19 -0800 (PST), Jonas Thörnvall
> <jonas.t...@gmail.com> wrote: 
> 
> >söndag 31 januari 2021 kl. 11:37:01 UTC+1 skrev John G Harris: 
> >> On Thu, 28 Jan 2021 10:54:10 -0800 (PST), Jonas Thörnvall 
> >> <jonas.t...@gmail.com> wrote: 
> >> 
> >> <snip> 
> >> >It is probably quite how a human would do it.... 
> >> <snip> 
> >> 
> >> How a human would do it when using pencil and paper is like this : 
> >> 1 2 + 
> >> result : 3 
> >> 3 4 + 
> >> result : 7 
> >> / 
> >> result : 3/7 or 0.4285714285714286 depending on which style you want. 
> >> 
> >> That's why, on an HP RPN calculator, you would do : 
> >> 1 2 + 3 4 + / 
> >> 
> >> John 
> >No that is actually not how we do it , first we find a part of the expression that we break out to solve between clause and paragraphs, then we start doing the primary */ operations since order matter, then the secondary ones +-. This we do repeatedly until a single operand is left and we call that result.
> That's right, you look at the expression, decide what order to do the 
> calculations in, then do them in that order. 
> 
> So, when the expression is (1 + 2)/(3 + 4) you calculate in this 
> order: 
> 1 2 +, then 3 4 +, then / 
> RPN! 
> 
> John
Some simple equation solving and graphing next.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

"Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 02:46 -0800
  Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 02:56 -0800
  Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 03:10 -0800
  Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 05:40 -0800
  Re: "Adhoc?" RPN mathparser using strings instead of stack. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-01-28 08:33 -0800
    Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 10:54 -0800
      Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 10:58 -0800
        Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-29 15:12 -0800
      Re: "Adhoc?" RPN mathparser using strings instead of stack. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-01-31 10:36 +0000
        Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-31 05:09 -0800
          Re: "Adhoc?" RPN mathparser using strings instead of stack. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-01-31 18:32 +0000
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-31 12:36 -0800
              Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-31 12:44 -0800
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-31 12:52 -0800
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-03 13:38 -0800
        Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-11 00:01 -0800
          Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-11 00:39 -0800
          Re: "Adhoc?" RPN mathparser using strings instead of stack. "sc...@sauyet.com" <scott@sauyet.com> - 2021-02-16 08:12 -0800
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-16 12:33 -0800
              Re: "Adhoc?" RPN mathparser using strings instead of stack. "sc...@sauyet.com" <scott@sauyet.com> - 2021-02-17 13:28 -0800
                Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-17 23:04 -0800
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-16 12:40 -0800
            Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-02-16 13:58 -0800
    Re: "Adhoc?" RPN mathparser using strings instead of stack. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-01-28 10:56 -0800

csiph-web