From: Libor S. <li...@gm...> - 2008-07-08 10:09:41
|
I was not really thinking about rationals and complex numbers and anything else yet. Just int, bigint and double, so far. Though I expect others could be extended in the same "permissive" spirit. Here are my defs for ndiv and slash (new /). In practice, you could of course just add these extra cases to the existing definitions without using new symbols: infixl 7 ndiv; x::double ndiv y = int x div y; x ndiv y::double = int (x/y); x ndiv y = x div y; > list slash infixl 7 slash; x::int slash y::int = x div y if x mod y==0; x slash y = x/y; I think they might be conformant with Eddie's implicit definition. Libor On Tue, 08 Jul 2008 00:29:05 +0100, Albert Graef <Dr....@t-...> wrote: > Ok, do you have definitions of div and mod for all other cases? Note > that then we also need definitions for the rational and complex numbers > in math.pure. > > I must admit that I never gave this much thought. Pure inherited div and > mod from Q which inherited them from Pascal which in turn inherited them > (I guess) from Algol 60. I'm not against extending them in a reasonable > manner. :) > > Albert > |