Deutsch English Français Italiano |
<vs15tq$21fdg$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com> Newsgroups: comp.lang.c Subject: Re: Fast division (was Re: Suggested method for returning a string from a C program?) Date: Wed, 26 Mar 2025 16:19:21 +0100 Organization: A noiseless patient Spider Lines: 34 Message-ID: <vs15tq$21fdg$1@dont-email.me> References: <vrd77d$3nvtf$2@dont-email.me> <vreuj1$1asii$4@dont-email.me> <vreve4$19klp$2@dont-email.me> <20250319201903.00005452@yahoo.com> <86r02roqdq.fsf@linuxsc.com> <vrh1br$35029$2@dont-email.me> <LRUCP.2$541.0@fx47.iad> <vrh71t$3be42$1@dont-email.me> <vrk8vm$2f4gc$1@paganini.bofh.team> <20250321113316.506@kylheku.com> <vrl6hp$2qg20$1@dont-email.me> <20250321210228.508@kylheku.com> <vrmg7d$2nif7$2@paganini.bofh.team> <vrvjr9$i7gg$1@dont-email.me> <vrvp60$m53l$1@dont-email.me> <vs10cd$3rsg0$1@paganini.bofh.team> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Wed, 26 Mar 2025 16:19:23 +0100 (CET) Injection-Info: dont-email.me; posting-host="e6a35e9678f9481385dd1adce673b0e8"; logging-data="2145712"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+O/hmU5Ryn2mctlcz+JWp2" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:cEef8CQJ8F1IUD92pf+FFYuAS74= In-Reply-To: <vs10cd$3rsg0$1@paganini.bofh.team> X-Enigmail-Draft-Status: N1110 On 26.03.2025 14:44, Waldek Hebisch wrote: > James Kuyper <jameskuyper@alumni.caltech.edu> wrote: >> On 3/25/25 21:04, Janis Papanagnou wrote: >>> On 22.03.2025 15:07, Waldek Hebisch wrote: >>>> >>>> Actually, to do fast division of N-bit number by fixed N-bit number >>>> one need 2N-bit multiplication. >>> >>> I just stumbled across your post and above sentence. Do you mean *one* >>> multiplication of 2N bit numbers? >> I think he meant "one needs 2N-bit multiplication". "one" is a pronoun >> in this context, not a number. > > Yes, of course "one" in my text above is a pronoun. I do not know > how Janis guessed one multiplication, but it is correct guess. The "one" was clear ("one need", "you need", "we need", etc.). What was unclear was whether there's indeed only one multiplication necessary. The "2N-bit multiplication" would also have been clear from its writing; meaning "[one] multiplication of 2N bit entities". But I couldn't imagine that a _general_ [non-const] division a/b could be done with only one multiplication. That's were I speculated whether you may have meant, say, "two N-bit multiplications" or some such. - That's why I was asking for confirmation. - Later I saw that you meant just a special case division a/c (with a _constant_ c), which of course can be pre-computed. Janis > [...]