axiom-mail
[Top][All Lists]
Advanced

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

Re: [Axiom-mail] Why no mod function?


From: Alasdair McAndrew
Subject: Re: [Axiom-mail] Why no mod function?
Date: Wed, 8 Aug 2007 09:50:13 +1000

There's no difference between "mod" and positiveRemainder; in fact if it were possible to rename positiveRemainder to mod then I'd be quite happy.  My reason for resorting to lisp was to create a function as simple as possible, and also as much as possible like the functions already in si.spad.  My hope was just to "drop" a definition of mod into this file and, err, have it all work.  I could have used

x mod y == x::ZMOD(y)

or

x mod y == (x::ZMOD(y))::INT

But, let's face it, "mod" is a stock-standard function; pretty much every mathematical system has it, so why not Axiom?

cheers,
Alasdair

On 08 Aug 2007 01:18:48 +0200, Martin Rubey <address@hidden> wrote:
Dear Alasdair,

apart from the technical issue of applying this patch to your local tree, I'd
like to advise you not to resort to lisp for this particular purpose.  Try to
stick to SPAD.  This will make it easier to reuse and debug your code.

In fact, reading

> x mod y == integer MOD(x,y)$Lisp

I do not really see what mod does exactly.  Since SPAD was made for expressing
maths, it should be easy to rewrite it in SPAD.

By the way, what's the difference to positiveRemainder?

Martin



reply via email to

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