Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!uucp.gnuu.de!doeblitz.net!.POSTED!not-for-mail From: Ralf =?UTF-8?Q?D=C3=B6blitz?= Newsgroups: comp.databases.postgresql Subject: Re: how to count the number of ipv6 addresses in a range? Date: Thu, 2 Apr 2015 16:48:36 +0000 (UTC) Organization: private site in Braunschweig, Germany Lines: 19 Archive: No Message-ID: References: <55197d18$0$2962$426a34cc@news.free.fr> <551a4f3d$0$3031$426a34cc@news.free.fr> NNTP-Posting-Host: selene.escape.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: selene.doeblitz.net 1427993316 22806 194.120.234.83 (2 Apr 2015 16:48:36 GMT) X-Complaints-To: usenet@selene.doeblitz.net NNTP-Posting-Date: Thu, 2 Apr 2015 16:48:36 +0000 (UTC) User-Agent: tin/2.1.1-20120623 ("Mulindry") (UNIX) (Linux/3.16.0-0.bpo.4-amd64 (x86_64)) Cancel-Lock: sha1:RjRLGHyXyPdqdzL2GMWHhux9KTU= Mail-Copies-To: nobody X-Face: MTa[OP$pr;PqMc)e|d9BmnYq|Ir0`Ijj)kNr"C:9lS:bjC1P`Y>eWC41xS,XF96GoZH8WOl ^L#i6KSohA`[`_P->X=Q|g?{H{B):V5>&z"M>njIRGN:5"VBu,OLOe%v6\{@iS X-Alignment: Lawful Evil X-No-Archive: Yes X-Archive: http:/www.netzverwaltung.net/archive/_outgoing/ Xref: csiph.com comp.databases.postgresql:647 Mateusz Viste wrote: > Hi, > > You are right of course, the scale of addresses count is far wider than > what I imagined (and I didn't take the time to do a proper calculation). > Thanks for the clue :) > > I will have to think about an alternative method of comparing ranges - > the need is simply to tell "this range is larger than that one", so an > exact count of IP addresses is not necessary. I would use the binary logarithm of the number of addresses. Ralf -- "ceterum censeo systemd esse delendam" Ralf Döblitz * Schapenstraße 6 * 38104 Braunschweig * Germany Mit UTF-8 kann man gleichzeitig äöüßÄÖÜæœłø‱¼½¾¤¹²³¢€£¥¶§¬÷×±©®™¡¿ verwenden …