[Jprogramming] Different results?
Roger Hui
RHui000 at shaw.ca
Sun Jan 22 19:40:35 HKT 2006
I guess <.@:%: could work the same as <.@%: , but not
for the reason you stated.
f at g"_ and f@:(g"_) need not be the same even if
f and g are rank 0. For example:
f=: 2"0
g=: i."0
f at g"_ ] 2 7 1
2 2 0 0 0 0 0
2 2 2 2 2 2 2
2 0 0 0 0 0 0
f@:(g"_) ] 2 7 1
2 2 2 2 2 2 2
2 2 2 2 2 2 2
2 2 2 2 2 2 2
f@(g"_) ] 2 7 1
2 2 2 2 2 2 2
2 2 2 2 2 2 2
2 2 2 2 2 2 2
----- Original Message -----
From: "Miller, Raul D" <rdmiller at usatoday.com>
To: "Programming forum" <programming at jsoftware.com>
Sent: Friday, January 20, 2006 7:11 AM
Subject: RE: [Jprogramming] Different results?
Roger Hui wrote:
> They should but they don't. The reason is that the interpreter
> didn't bother to make a special case for <.@:%:, since that
> would only produce an extended precision result for a singleton
> argument.
I must confess that I don't follow this explanation
Since both <. and %: are rank 0, it seems to me that
<: @ %:_" and <: @: (%:"_) are logically the same
operation.
I can understand that it wasn't implemented that way,
but I don't see why a special implementation would further
need to special case a singleton argument.
More information about the Programming
mailing list