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


Groups > comp.lang.javascript > #27262

Re: Best search algorithm to find a condition within a range.

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: Best search algorithm to find a condition within a range.
Date 2015-04-09 14:55 +0200
Organization solani.org
Message-ID <mg5ss7$8i5$2@solani.org> (permalink)
References (8 earlier) <XnsA475D09719F9Ceejj99@194.109.133.246> <5902185.dpbNY2YNC7@PointedEars.de> <XnsA475E324A1947eejj99@194.109.133.246> <1936096.bgrWbIOXpn@PointedEars.de> <XnsA477904D03C6Aeejj99@194.109.133.246>

Show all headers | View raw


Evertjan. wrote:

> The advice given was to add zero's in front of the "shortest" stringified 
> number.
> 
> There is no way to do that without first retrieving the "length" of both
> and assessing the difference to know how many zerows to add.
> 
> So the length difference so already there, and there is no need to add the 
> zero characters when this difference != 0, since that value already answers 
> the comparison. And there is no need to add them when they are equal too, 
> btw.

Why would someone try to do integer arithmetic on strings?  I would
suggest to use a large base, where each digit is an element of an array.
 IIRC Ben (Bacarisse) has already suggest this.

-- 
Christoph M. Becker

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


Thread

Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 02:43 -0700
  Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 13:07 +0200
    Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 04:38 -0700
      Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 04:48 -0700
      Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 14:49 +0200
  Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 13:27 +0100
    Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:04 -0700
      Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 14:23 +0100
        Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:54 -0700
          Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 16:31 +0100
            Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 08:59 -0700
              Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 19:58 +0100
                Re: Best search algorithm to find a condition within a range. Dr J R Stockton <reply1500@merlyn.demon.co.uk.invalid> - 2015-04-09 23:08 +0100
                Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-10 00:02 +0100
            Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 18:37 +0200
              Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 09:55 -0700
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 20:30 +0200
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-07 20:58 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 22:19 +0200
                Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-08 00:14 -0700
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-08 10:55 +0200
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 13:03 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 14:11 +0200
                Re: Best search algorithm to find a condition within a range. "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-09 14:55 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 15:20 +0200
                Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-09 14:49 +0100
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 16:10 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:17 +0200
                Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 07:22 -0700
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:44 +0200
                Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 07:57 -0700
                Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-09 08:05 -0700
                Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-09 17:04 +0100
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 16:14 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 16:34 +0200
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 17:39 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 18:04 +0200
                Re: Best search algorithm to find a condition within a range. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-09 18:26 +0200
                Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-09 22:13 +0200
              Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 10:00 -0700
    Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:16 -0700
      Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 15:28 +0200
        Re: Best search algorithm to find a condition within a range. jonas.thornvall@gmail.com - 2015-04-07 06:58 -0700
          Re: Best search algorithm to find a condition within a range. "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-04-07 20:25 +0200
      Re: Best search algorithm to find a condition within a range. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-04-07 14:33 +0100

csiph-web