qdivrem.c (8876) | qdivrem.c (18207) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * | 1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * --- 20 unchanged lines hidden (view full) --- 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * |
37 * $Id: qdivrem.c,v 1.2 1994/08/02 07:44:19 davidg Exp $ | 37 * $Id: qdivrem.c,v 1.3 1995/05/30 08:06:42 rgrimes Exp $ |
38 */ 39 40/* 41 * Multiprecision divide. This algorithm is from Knuth vol. 2 (2nd ed), 42 * section 4.3.1, pp. 257--259. 43 */ 44 | 38 */ 39 40/* 41 * Multiprecision divide. This algorithm is from Knuth vol. 2 (2nd ed), 42 * section 4.3.1, pp. 257--259. 43 */ 44 |
45#include "quad.h" | 45#include <libkern/quad.h> |
46 47#define B (1 << HALF_BITS) /* digit base */ 48 49/* Combine two `digits' to make a single two-digit number. */ 50#define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) 51 52/* select a type for digits in base B: use unsigned short if they fit */ 53#if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff --- 224 unchanged lines hidden --- | 46 47#define B (1 << HALF_BITS) /* digit base */ 48 49/* Combine two `digits' to make a single two-digit number. */ 50#define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) 51 52/* select a type for digits in base B: use unsigned short if they fit */ 53#if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff --- 224 unchanged lines hidden --- |