a=. 1+1e_48
   3!:0 a
8
   (= <.)a
1

comparison is tolerant, isInt can work but it depends on whether you want
to test looks like an integer or its storage class is integer data type.

On 4 Apr, 2017 3:34 am, "Louis de Forcrand" <[email protected]> wrote:

A few useful shortcuts:

isBoxed=: 0 < L.
isChar=: {.@, e. a."_
isInt=: = <.
isReal=: = +

Louis

> On 2 Apr 2017, at 14:43, 'Pascal Jasmin' via Programming <
[email protected]> wrote:
>
> datatype or 3!:0
>
>
> datatype 3 4.1 0
>
>
>
>
> ________________________________
> From: Herbert Weissenbaeck // Privat <[email protected]>
> To: [email protected]
> Sent: Sunday, April 2, 2017 8:33 AM
> Subject: [Jprogramming] type/domain of an argument
>
>
>
> quick beginner's question:
>
> how can i test whether an x or y argument is an array of int or an array
of float or an array of char or of any other type (to avoid domain errors
and handle different types differently in functions)?
>
> thank you
>
> herbert
>
>
> ----------------------------------------------------------------------
>
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
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