Re: why infix::(Int, Int --> Rat)

2008-12-05 Thread TSa
HaloO, David Green wrote: On 2008-Dec-4, at 3:08 pm, Mark J. Reed wrote: Using "div" instead of "/" should make it pretty clear that you're disposing of the remainder. I strongly agree to that. Actually you are disposing of the fractional part. I misremembered div vs. idiv, but how standar

Re: why infix::(Int, Int --> Rat)

2008-12-05 Thread TSa
HaloO, Mark J. Reed wrote: Well, respelling it is OK, just not sure how. Python 3 uses // for integer division, but we don't want to open up that can of worms again.. We still haven't used '÷' which is Latin1. But if we use that it should be as infix:<÷>:(Int, Int --> Rat) because this doesn'

Re: why infix::(Int, Int --> Rat)

2008-12-05 Thread Mark J. Reed
On Fri, Dec 5, 2008 at 9:10 AM, David Green <[EMAIL PROTECTED]> wrote: > I misremembered div vs. idiv, but how standard is it? I know "div" commonly > means int division, but not always. True enough. In ANSI C, / already does integer division, but there's also a div() function - the difference th

Re: why infix::(Int, Int --> Rat)

2008-12-05 Thread David Green
On 2008-Dec-4, at 3:08 pm, Mark J. Reed wrote: Using "div" instead of "/" should make it pretty clear that you're disposing of the remainder. I misremembered div vs. idiv, but how standard is it? I know "div" commonly means int division, but not always. On the one hand, some things you j

Re: why infix::(Int, Int --> Rat)

2008-12-04 Thread Mark J. Reed
On Thu, Dec 4, 2008 at 3:26 PM, David Green <[EMAIL PROTECTED]> wrote: > Something more explicit like "idiv" was suggested for integral division. > Personally, I'm happy not to have anything special provided for it, on the > grounds that having to say, e.g. "floor($i/$j)", forces you to be blatant

Re: why infix::(Int, Int --> Rat)

2008-12-04 Thread David Green
On 2008-Dec-4, at 9:42 am, TSa wrote: I remember the state of affairs being that [div] returns an Int Something more explicit like "idiv" was suggested for integral division. Personally, I'm happy not to have anything special provided for it, on the grounds that having to say, e.g. "floor(

why infix::(Int, Int --> Rat)

2008-12-04 Thread TSa
HaloO, I realized from the typed literal thread that S03 now explicitly states that div on two Ints returns a Rat. I remember the state of affairs being that it returns an Int that adheres to the division of an Int $y by another Int $x such that $y == ($y div $x) * $x + ($y mod $x) holds w