The answer to your question is that int % int in J
is closed if the result type is float but not if
it is int.

I am curious: what is the result of the following 
expression in Dyalog APL?

   #DR 548590 556138 1375147 1 % 17



----- Original Message -----
From: Mike Day <[EMAIL PROTECTED]>
Date: Sunday, October 22, 2006 1:53 am
Subject: Re: [Jprogramming] Interger division, the faster one

> (T)ouch(e) !
> 
> Me culpa. I hadn't realised - or checked - that
>   integer quotient % integer divisor
> is always floating. 
> 
> But why?
> 
> For example, Dyalog APL retains an integer type for
> similar arguments:
>      #DR 17    @ short integer
> 83
>      #DR 548590 556138 1375147 @ long int
> 323
>      #DR 548590 556138 1375147 % 17
> 323


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to