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


Groups > comp.lang.python > #198035

Re: myrkraverk.c

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups comp.lang.python, comp.lang.c, sci.math
Subject Re: myrkraverk.c
Followup-To comp.lang.python, comp.lang.c
Date 20 Sep 2026 12:25:03 GMT
Organization Stefan Ram
Lines 18
Expires 1 Sep 2027 11:59:58 GMT
Message-ID <bits-20260920132258@ram.dialup.fu-berlin.de> (permalink)
References <X0ArS.155893$NMu2.109571@fx15.ams4> <bits-20260919192308@ram.dialup.fu-berlin.de> <JbBrS.493032$a02.417651@fx11.ams4> <118mo9b$2i0j0$1@dont-email.me> <WjCrS.369387$G71.22768@fx17.ams4> <extension-20260919213739@ram.dialup.fu-berlin.de> <w9OrS.493051$a02.195416@fx11.ams4>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de cLx3khtbsji3VicVglKrggnBL4NeU8+LhLw4raJhP3so1+
Cancel-Lock sha1:h3YjgF0XEdvbkR3L34X/2GiSLUA= sha256:uV8XuJ7cNot+evJefOGohMKMs7RgNtBG6MKnPJFa+P8=
X-Copyright (C) Copyright 2026 Stefan Ram. All rights reserved. Distribution through any means other than regular usenet channels is forbidden. It is forbidden to publish this article in the Web, to change URIs of this article into links, and to transfer the body without this notice, but quotations of parts in other Usenet posts are allowed.
X-No-Archive Yes
Archive no
X-No-Archive-Readme "X-No-Archive" is set, because this prevents some services to mirror the article in the web. But the article may be kept on a Usenet archive server with only NNTP access.
X-No-Html yes
Content-Language en
Xref csiph.com comp.lang.python:198035 comp.lang.c:402297 sci.math:647534

Cross-posted to 3 groups.

Followups directed to: comp.lang.python, comp.lang.c

Show key headers only | View raw


"Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> wrote or quoted:
>       _BitScanForward( &index, *digits ) ;

  From the documentation:

|If no bit is found, the function returns 0 and the value
|written to the address in the first parameter is undefined.

  . However, if there are 32 0s before a 1 is found, this 
  might be intended to add "32" to the total zero count.

  (GCC's and Clang's "__builtin_ctz" can also count bits and
  might be more portable.)

Newsgroups: comp.lang.python,comp.lang.c,sci.math
Followup-To: comp.lang.python,comp.lang.c

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


Thread

( n & -n ).bit_length() - 1 ## Really? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 01:56 +0800
  Re: ( n & -n ).bit_length() - 1 ## Really? ram@zedat.fu-berlin.de (Stefan Ram) - 2026-09-19 18:23 +0000
    Re: ( n & -n ).bit_length() - 1 ## Really? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 03:15 +0800
      Re: ( n & -n ).bit_length() - 1 ## Really? Lane W <cactus_DAC@yahoo.com> - 2026-09-19 13:37 -0600
        Re: ( n & -n ).bit_length() - 1 ## Really? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 04:32 +0800
          Re: ( n & -n ).bit_length() - 1 ## Really? ram@zedat.fu-berlin.de (Stefan Ram) - 2026-09-19 20:39 +0000
            Re: ( n & -n ).bit_length() - 1 ## Really? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 04:56 +0800
            myrkraverk.c (was: Re: ( n & -n ).bit_length() - 1 ## Really?) "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 18:00 +0800
              Re: myrkraverk.c ram@zedat.fu-berlin.de (Stefan Ram) - 2026-09-20 12:25 +0000
                Re: myrkraverk.c "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 21:33 +0800
                Re: myrkraverk.c ram@zedat.fu-berlin.de (Stefan Ram) - 2026-09-20 13:48 +0000
                Re: myrkraverk.c "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 22:09 +0800
              jacobi_symbol.py (was: Re: myrkraverk.c) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-21 20:34 +0800
                Re: jacobi_symbol.py Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-22 15:20 +0800
                Re: jacobi_symbol.py Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-09-25 23:32 +0800
          Re: ( n & -n ).bit_length() - 1 ## Really? "Johann \"Myrkraverk\" Oskarsson" <johann@myrkraverk.invalid> - 2026-09-20 04:52 +0800
  Re: ( n & -n ).bit_length() - 1 ## Really? Paul Rubin <no.email@nospam.invalid> - 2026-09-19 14:50 -0700

csiph-web