|
From: | Elias Mårtenson |
Subject: | Re: [Bug-apl] Determining data type... |
Date: | Fri, 1 Aug 2014 09:51:53 +0800 |
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
>
[Prev in Thread] | Current Thread | [Next in Thread] |