gcd problem



>>>>> "Andreas" == Andreas Eder <aeder at arcor.de> writes:

    Andreas> Raymond writes:

    >> I think we should just get rid of the f+, f-, f* macros/functions.
    >> Well, actually redefine them so they don't assert that the operands
    >> and results are fixnums.

    Andreas> That is just what I am thinking, and in the course of my code cleanup
    Andreas> action I'm also replacing all these fixnum specific macros by the
    Andreas> generic operation.

Unfortunate in some ways.  At least with the macros, you had some idea
that the author thought the numbers should be "small".  Now you
don't.  However, this is particularly bad with gcl (and perhaps
others) that just believe you and truncate the numbers to get wrong
results.

    >> Perhaps things will run a little slower, but machines are hundreds
    >> (thousands?) of times faster now than when maxima was originally
    >> written.

    Andreas> hope this will make the code more robust. And sbcl - by the way - is also
    Andreas> often capable of finding out if fixnum arithmetic will be safe without
    Andreas> declarations; especially when they are misleading.

In specific code, this is true, but most of the code in maxima isn't
of that type, except, perhps, the parts that compute numerical
answers.

    Andreas> Asking the user if he really wants to do a calculation if
    Andreas> certain limits are reached might nevertheless be a good
    Andreas> option as Richard suggested.

Yes, as long as the limits can be set by the user.

How is this idea supposed to work with the trend of having maxima not
asking any questions at all anymore?  Just give an error and exit?

Ray