is_integer =: ( = <. ) :: 0:

Does what I want, but I am still wondering how

isinteger =:: ( -: <. ) :: 0:

returns a single boolean result.

----- Original Message Follows -----
From: [email protected]
To: Programming forum <[email protected]>
Subject: [Jprogramming] validate.ijs - isinteger
Date: Sun, 14 Jun 2009 08:17:28 -0800

>I want to use the validate.ijs verb isinteger.
>
>    isinteger 3
>1
>    isinteger 3 3.5
>0
>
>The isinteger verb returns a boolean 0/1 depending if all
>the data is integer.
>
>I wanted to use it to return a boolean vector/array/matrix
>depending based on
>each is an integer or not.
>
>I figured, I will just look at the results of doing:
>
>    isinteger
>( -: <. ) :: 0:
>
>So I tried:
>    ( -: <. ) 1 2 3
>1
>    ( -: <. ) 1 2.2 3
>0
>
>which is the same result as:
>     isinteger 1 2 3
>1
>     isinteger 1 2.2 3
>0
>
>Could somebody please explain why:
>
>given y is a vector
>
>( -: <. ) y
>
>returns a scalar?
>
>thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>-----------------------------------------------------------
>----------- For information about J forums see
>http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to