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


Groups > comp.lang.javascript > #25395

General solution to get the previous value

Newsgroups comp.lang.javascript
Date 2014-07-15 17:25 -0700
Message-ID <314cbe9e-975c-4bb1-9e95-b2c90eca3388@googlegroups.com> (permalink)
Subject General solution to get the previous value
From jonas.thornvall@gmail.com

Show all headers | View raw


number=29;
basemultip=1;
base=3;

while (basemultip < number)
   {
      prevmultip=basemultip;
      basemultip = basemultip * base;
     
   }
basemultip=prevbase;

What is the solution to have the previous value when you walk out from loop, i think my code look strange and i probably learned how to do this but forgot about it.

Can i do it without buffering the previous value?

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


Thread

General solution to get the previous value jonas.thornvall@gmail.com - 2014-07-15 17:25 -0700
  Re: General solution to get the previous value jonas.thornvall@gmail.com - 2014-07-15 21:25 -0700
    Re: General solution to get the previous value Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-16 13:06 +0100
  Re: General solution to get the previous value Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-16 07:23 -0700
    Re: General solution to get the previous value jonas.thornvall@gmail.com - 2014-07-16 07:58 -0700
      Re: General solution to get the previous value jonas.thornvall@gmail.com - 2014-07-16 13:35 -0700
    Re: General solution to get the previous value Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-07-16 17:05 +0100
      Re: General solution to get the previous value jonas.thornvall@gmail.com - 2014-07-16 11:07 -0700
      Re: General solution to get the previous value Scott Sauyet <scott.sauyet@gmail.com> - 2014-07-16 12:13 -0700
      Re: General solution to get the previous value "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-16 22:45 +0200

csiph-web