It doesn’t ignore the imaginary part but associativity is
(2e4)j1.4 rather than 2e(4j1.4)

But 2e3.4 ought to work.
And why would it rather be an error than 2p3.4?
Every line of code has Levenshtein distance 1 to something that doesn’t work. Making 2e3.4 work at the very least helps solve the useful problem of learning the syntax of J numeric literals.

Am 08.11.21 um 16:21 schrieb 'robert therriault' via Programming:
Also scientific notation can take complex numbers but it ignores the imaginary 
part which means that the imaginary part can be non integers.

     2e4j1.4
20000j1.4

Cheers, bob


On Nov 8, 2021, at 04:09, 'Mike Day' via Programming 
<[email protected]> wrote:

Also,  surely the integer restriction is consistent with the “scientific 
notation” that’s so pervasive in science and in computer languages.

Cheers,

Mike

Sent from my iPad

On 8 Nov 2021, at 11:47, Raul Miller <[email protected]> wrote:

Conceptually, 2e3.4 would be 2 * 10^3.4 or approximately 5023.77

But, the code path for handling the part on the right of the 'e'
currently only handles integer values.

So when you ask "why", I guess you are asking "why not allow any
values representable by the constant format".

And, I think the reason there is that 2e3.4 is more likely to be a
typographical error than an intentional use of the notation. These
language choices are somewhat heuristical, of course, but try thinking
of it this way:

"If this were possible, what useful problems would it help solve?"

Thanks,

--
Raul

On Mon, Nov 8, 2021 at 12:17 AM Elijah Stone <[email protected]> wrote:

   2x3.4
59.9282
   2p3.4
98.0256
   2e3.4
|ill-formed number
|   2e3.4
|   ^

Whyn't?
----------------------------------------------------------------------
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


--
----------------------
mail written using NEO
neo-layout.org

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to