Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!ihnp4!amdcad!tim From: tim@amdcad.AMD.COM (Tim Olson) Newsgroups: comp.lang.c Subject: Re: The need for D-scussion (was Re: D Wishlist) Message-ID: <20797@amdcad.AMD.COM> Date: 14 Mar 88 18:29:07 GMT References: <12176@brl-adm.ARPA> <1988Mar11.215238.976@utzoo.uucp> <3732@bloom-beacon.MIT.EDU> Reply-To: tim@amdcad.UUCP (Tim Olson) Organization: Advanced Micro Devices Lines: 26 In article <3732@bloom-beacon.MIT.EDU> tada@athena.mit.edu (Michael Zehr) writes: | | Here's another one for the D wishlist: | | a function the returns both a % b and a / b at the same time. | | I know I've had to call those routines with the same values consecutively | in code that needed to run fast, and if i understand the library right, they | both compute the pair of values, but a different one is returned. Why not | give the option of getting them both at the same time? If you have a good compiler, you can already get this. The low-level divide function for the MetaWare - Am29000 C compiler returns the / value in the specified register, and returns the % value in the standard function return-value register. Therefore, in code like while (n > 0) { buf[i++] = (n%10) + '0'; n /= 10; } only one call to the low-level divide routine is made. -- Tim Olson Advanced Micro Devices (tim@amdcad.amd.com)