Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: The problem with implementation defined behaviour. Date: Thu, 31 Mar 2016 11:49:10 -0700 Organization: A noiseless patient Spider Lines: 9 Message-ID: <87vb42sct5.fsf@nightsong.com> References: <56fa93aa$0$5868$e4fe514c@news.xs4all.nl> <2016Mar29.182032@mips.complang.tuwien.ac.at> <4b57b1ee-841e-4007-8812-0c0810620dec@googlegroups.com> <2016Mar30.095908@mips.complang.tuwien.ac.at> <5d973aa6-707b-4e4b-b510-2f62acf80c5d@googlegroups.com> <2016Mar31.125525@mips.complang.tuwien.ac.at> <2016Mar31.182116@mips.complang.tuwien.ac.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="ac130717aa033f117b1251f50cb4c61b"; logging-data="28332"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1927m6H6oWqBkhOKflf9mqk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:iuFpL5R3pwe2E2BjkUT8k5JRung= sha1:Th/ynLL+GnYSbauJwgvxdYhmdfI= Xref: csiph.com comp.lang.forth:46364 anton@mips.complang.tuwien.ac.at (Anton Ertl) writes: > That's not necessary, but it means that the results of these > microbenchmarks may say more about your optimizations than about > floored vs. symmetric division on your hardware. I know div, mod, and divMod in Haskell (like /, mod, and /mod in Forth) give floored division, and if your program uses them a lot and doesn't actually need floored division, you can often get a worthwhile speedup by using quot, rem, and quotRem (symmetric division) instead.