Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: on an analogy for verifying whether another digit fits (into an unsigned type) Date: Sun, 23 Jan 2022 14:26:26 -0800 Organization: None to speak of Lines: 28 Message-ID: <87pmoixf59.fsf@nosuchdomain.example.com> References: <86mtjws9cg.fsf@levado.to> <6df246f4-204e-4fd1-ad91-bb4fce96f100n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="bf212cab00378f73488330ba3dd56683"; logging-data="3010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eIok5xxMfdP4MXmIb4EVr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:wBhc0sXOirUNI8xyKH9qKkZ4LxI= sha1:dnShaN/nbtUnfiPFM5cIgsWN3q8= Xref: csiph.com comp.lang.c:164558 Bart writes: > On 19/01/2022 18:46, Scott Lurndal wrote: >> Bart writes: >>> On 19/01/2022 17:02, Bonita Montero wrote: >>> Complicated. I used the simpler **C** code below. It's runtime was 10% >>> slower than the C++ (that is, elapsed time of the 10,000 outer loop for >>> both). >> I just use strtoll. Why reinvent the wheel? > > It needs to be stroull() for this purpose, which is more elusive (gcc > has it on Windows, but the two other compilers I have don't), gcc does not provide strtoll() or strtoull(). Both are provided by the library, not by the compiler. (And both were introduced in C99, so I'd be at least mildly surprised by an implementation that provides one but not the other.) I know you're tired of people pointing out that the compiler (gcc in this case) does not provide library functions. The solution is for you to stop making that mistake. Or should I assume you enjoy these arguments? [...] -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips void Void(void) { Void(); } /* The recursive call of the void */