[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-apl] Determining data type...
From: |
David B. Lamkins |
Subject: |
Re: [Bug-apl] Determining data type... |
Date: |
Thu, 31 Jul 2014 15:46:02 -0700 |
Reshape your datum as an empty vector then match to zilde. If the match
succeeds then your datum is a number; otherwise a character/string.
I believe that there's a circle function to extract the imaginary part
of a number, if any. You can test for a nonzero imaginary part.
Finally, you can compare a number's floor to the number itself to
determine whether the value is integer or real.
Not knowing your application, I have to warn you that you shouldn't use
these tests to infer anything about APL's storage. All of the numeric
tests are subject to quad-CT.
On Thu, 2014-07-31 at 15:54 -0400, Peter Teeson wrote:
> I feel pretty stupid.
> Looked in the APL2 IBM manual but do not understand how to determine the data
> type of a variable.
> Neither the primitives nor the Quads sparked the answer in my brain.
> It must be something pretty obvious but not to me right now.
>
> So if I have a function FOO X how do I determine if X is character, integer,
> float, or imaginary?
> Assuming that it is not a nested array of course.
>
> respect…
>
> Peter
>
- [Bug-apl] Determining data type..., Peter Teeson, 2014/07/31
- Re: [Bug-apl] Determining data type...,
David B. Lamkins <=
- Re: [Bug-apl] Determining data type..., Elias Mårtenson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Peter Teeson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Elias Mårtenson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Peter Teeson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Elias Mårtenson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Kacper Gutowski, 2014/07/31
- Re: [Bug-apl] Determining data type..., Elias Mårtenson, 2014/07/31
- Re: [Bug-apl] Determining data type..., Blake McBride, 2014/07/31
Re: [Bug-apl] Determining data type..., Kacper Gutowski, 2014/07/31