Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.arch Subject: Re: endian history Date: Fri, 18 Sep 2026 00:38:39 -0700 Organization: A noiseless patient Spider Lines: 27 Message-ID: <868q4zuhz4.fsf@linuxsc.com> References: <10uks4f$1dqo$1@gal.iecc.com> <10vnjp6$1df4$1@gal.iecc.com> <10vns1f$3a252$1@dont-email.me> <10vpblp$3mkd1$1@dont-email.me> <10vphh0$3o9jl$1@dont-email.me> <117gj6t$1b95v$2@dont-email.me> <6a9c1c93.39172234@news.eternal-september.org> <117j3es$24qgq$6@dont-email.me> <117n6ho$35j69$1@paganini.bofh.team> <6a9f7664.1891062@news.eternal-september.org> <2026Sep8.125659@mips.complang.tuwien.ac.at> <117pnpg$f179$2@dont-email.me> <11898n9$1nc06$2@dont-email.me> <118d6ld$1tkm9$1@paganini.bofh.team> <118dl5f$37cfv$1@dont-email.me> <118e8kg$3f05h$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 18 Sep 2026 07:38:42 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1120193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19tOuSQgbuIDm8+IcUipiKph/WlRgWjX7A="; posting-host="742ba13f59dd80260e7d5d77f8995b11" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:J9/63p1TaF/poXPuPpkYrx/hJgs= sha1:pSC2dEcESKbmCuU2kalOye4MSyY= sha256:X7S3XRyC9ryS4cvhBC/C9FzQIX9CNzec+I4fMZK+lxI= sha1:/bLonvyxFa/sv32hNmajT8kpfSM= sha256:lNaf+DF79ZUpX4yDK9QVIR41I6FOcqXip7YuISMAx40= Xref: csiph.com comp.arch:118087 Terje Mathisen writes: [...] > There was an Advent of Code puzzle in 2022 (last day) where you had to > work in symmetrical base-5, using '-' and '=' for -1 and -2, along > with '0', '1', '2'. > > You had to parse 113 such numbers, all happened to be positive, but > they did of course not need to be. With symmetrical encoding, there is > no extra minus sign in front, just a negative first digit. > > The fast solutions did each input line/number in about 4-5 us, then > you had to return the (decimal) sum, before converting that back to > the same base-5 system. I'm wondering why a seemingly simple problem took as much time as this. Maybe I'm misunderstanding the problem statement. Is there one (base negative 5) input number per line? Surely converting such an input to binary can be done more quickly than 4 microseconds. > Just like decimal, it is a lot easier to convert ascii to binary than > binary to ascii, the difference between div/mod every digit and a > single mul. Now I'm curious to see how you implemented the binary-to-ascii part of the problem. Do you still have the code around?