guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] New division operators, and optimization for fractions


From: Mark H Weaver
Subject: [PATCH] New division operators, and optimization for fractions
Date: Thu, 10 Feb 2011 18:42:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hello all,

Here are three more patches.  The first adds fast implementations of the
remaining number-theoretic division operators as described in Taylor
Campbell's proposal: floor/, ceiling/, truncate/, round/, as well as the
single-valued variants.  The third patch optimizes the case where both
arguments are exact and at least one is a fraction.

The second patch is needed by the third.  It adds an internal C function
that extracts two values from a values object.  I needed it because my
optimization for fractions works by calling the same division operator
recursively on a subproblem involving only integers, and I need a way to
extract the two values.  Initially, I began to make internal versions of
the divide functions that returned their two values via parameters of
type (SCM *), but then I realized that in the cases where I dispatch
into GOOPS, I'd still need to extract from a values object.

If I've overlooked some existing mechanism for extracting multiple
values from C, or if you have a better idea, please let me know and I'll
rework the patch.

Note that these patches should be applied after the ones in my recent
post entitled "Miscellaneous fixes and improvements".

    Best,
     Mark


Attachment: 0001-Add-four-new-sets-of-fast-quotient-and-remainder-ope.patch
Description: Add four new sets of fast quotient and remainder operators

Attachment: 0002-Added-internal-C-function-to-extract-from-values-obj.patch
Description: Added internal C function to extract from values object

Attachment: 0003-Optimize-division-operators-handling-of-fractions.patch
Description: Optimize division operators handling of fractions


reply via email to

[Prev in Thread] Current Thread [Next in Thread]