Thinking that all these years (decades?) I could have written _.5 instead
of _0.5! I was wondering if anyone had used that form before in actual
code and I searched the forum posts; apparently, although there are pleanty
of instances of _0.5 nobody has used _.5 in actual code, at least in
It appears that the construct 2r.2 is not described in NuVoc and that
it is , in fact equivalent to 2%0.2 or 20r2. it is similar to 1p.2
==1p0.2 or pi to the power of 0.2
you are dealing with nouns in either case and there is a built in
conversion that allows the use of 2r.2 to be treated a
To summarize:
A word is numeric if and only if it begins with 0-9 or _
Within a numeric word, zero is not required before a decimal point.
1e.4 is not allowed because the exponent must be an integer.
Henry Rich
On 7/1/2017 1:46 PM, Martin Kreuzer wrote:
Raul -
* Many thanks for pointing ou
Raul -
* Many thanks for pointing out the difference
between (.) the character and (.) the conjunction; has made it very clear.
* Powers of 10 -- the Dictionary says under
/Constants that "The form of a numeric constant
... is elaborated by the use of further letters,
as in 2r3 for two-thir
Agreed.
-M
At 2017-07-01 15:26, you wrote:
I think the inconsistency you are pointing to here is that r. as a
verb has a different meaning from r in number formation?
But I think that that's a red herring. For example, e. as a verb has a
different meaning from e in number formation.
Thanks,
The fog is lifting. I realize that trying to learn J the way I learned
Fortran, PL/I and C is not the right way to go. J is truly special. The
Dissect tool is great. I also realized that paying attention to the colors of
the tokens in the jqt editor eliminates many stupid errors. Many thank
I think the inconsistency you are pointing to here is that r. as a
verb has a different meaning from r in number formation?
But I think that that's a red herring. For example, e. as a verb has a
different meaning from e in number formation.
Thanks,
--
Raul
On Sat, Jul 1, 2017 at 7:34 AM, Mart
Looking at word formation is important for understanding this issue:
;:'2 .3 .4 .5'
+-+-+-+-+-+-+-+
|2|.|3|.|4|.|5|
+-+-+-+-+-+-+-+
;:'0.2 0.3 0.4 0.5'
+---+
|0.2 0.3 0.4 0.5|
+---+
;:'3j.4'
++
|3j.4|
++
An issue here is that . is a conjunction and passing
Looking at (r.) Angle, which is a verb somewhat similar to (j.) Complex, I get
2 r. 0.2
1.96013j0.397339
2 r.0.2
1.96013j0.397339
2 r. 2
_0.832294j1.81859
2 r.2
_0.832294j1.81859
which all four look fine to me, but are not
constistent with (j.)'s behaviour, that's been my point ...
this is parsed as a token
;:'3e.4'
++
|3e.4|
++
but it (rightfully?) throws an error
3e.4
|ill-formed number
this is also parsed as a token
;:'3j.4'
++
|3j.4|
++
the behavior seems endemic
3p.4
4.74221
3ad.4
2.3j0.0209438
3ar.4
2.76318j1.16826
3x.4
4.47547
It is valid, but don’t think it is what was intended …
The following 2 statements produce the same result:
3j5
3j5
(3) j. (5)
3j5
And these 2 statements produce the same result also.
3j.4 NB. This is a valid complex constant of 3+i*0.4
3j0.4
(3) j. (0.4)
3j0.4
As Raul pointed o
Looking at the examples, I came across the difference between
3 j. 4 NB. spaces
3j4
and
3j.4 NB. no spaces
3j0.4
Given that this (rightfully) throws an error
.2 .3 .4 .5
|syntax error
|.2 .3 .4 .5
while this doesn't
0.2 0.3 0.4 0.5
0.2 0.3 0.4 0.5
why then is
> As Henry points out, the NuVoc page is quite a bit clearer on this topic.
Sample google search:
site:jsoftware.com inurl:nuvoc complex
Quite a bit of reading there, if you have the patience for it (be sure
to mix in plenty of trial and error, though, or it's a total snoozer).
Thanks,
--
R
A few notes...
0j is giving you the ill formed number diagnostic. A reference
document is at http://www.jsoftware.com/help/dictionary/dcons.htm but
syntactically, the use of j in a number should follow the same pattern
as using e in a number. You don't say 10e and similarly you don't say
10j ...
Hi Lawrence, the “ill-formed number” is because "j." is a verb, quite different
to “j” which is part of a noun construct (like 3j4, or 1e3 for 1000).
So in your examples ...
NB. But wait, not so fast:
1j.(2^0.5)%2
|ill-formed number
NB. No
NB. Now try to separate the “j.” verb with a space ei
First tip: Rather than using the Dictionary, use NuVoc.
Second tip: learn how to use the dissect tool.
Third tip: understand what "the rank of a verb" means.
I can't figure out your basic wrongthink here but let me point out that
j. is a verb that joins two nouns to make a complex noun, while
Hello, I am a old EE still trying to learn. I am a real beginner having no
end of problems with specifying complex numbers. I am using j64-804 on ubuntu
12.04. I am either doing something really stupid or I need to update to 806.
Updating anything gives me heartburn or worse so I hope it is
17 matches
Mail list logo