Oh, and in terms of what I would expect: I would expect, in general, for 1x1 1x to act like 1x1,1x for 1j2 3e4 5x to act like 1j2,3e4,5x etc.
The change required to meet that expectation would be backwards compatible. Right now, the interpreter has a nice feature that no matter how you write a constant, J stores it internally using the "smallest" possible data type (eg 0, 0.0, 0j0 etc all use the same number of bytes), with the exception that x and r always force extended or rational format, respectively. To make 1x1 1x and similar phrases "work", we need only to lift that latter qualification. Constants requesting precision which can't be satisfied would simply be denied extended precision, rather than raise errors. -Dan Sent from my iPhone > On Jan 24, 2014, at 5:42 PM, Dan Bron <[email protected]> wrote: > > I should probably have pointed out that this is a general problem related to > the ambiguous interpretation of x in numerical constants, not only > constrained to those which contain both exponential notation. > > For example, > > 1e1 1x > |ill-formed number > 1j0 1x > |ill-formed number > > Etc. > > -Dan > > > Sent from my iPhone > >>> On Jan 24, 2014, at 5:33 PM, Raul Miller <[email protected]> wrote: >>> >>> On Fri, Jan 24, 2014 at 5:26 PM, Dan Bron <[email protected]> wrote: >>> notation (i.e. the digit meaning 33, as in 16b1a2b3c9x). Second, We >>> also use x to represent Euler's number in exponential notation, as in >>> 1x1, >>> and sometimes the interpreter gets confused about whether you mean >>> extended precision or exponential numbers (e.g. 1x1 1x an >>> "ill-formed number") . >>> >>> http://www.jsoftware.com/pipermail/general/2004-April/016876.html >>> >>> [2] There are some corner cases where extended-precision calculations must >>> fall back to floating point. >> >> All of which makes me wonder what you expect for 1x1 1x. >> >> Consider: >> >> 1x1 >> 2.71828 >> 1x >> 1 >> >> Logically speaking, I think I would expect 1x1 1x to give me an exact >> representation of ^1 0. But that's irrational. >> >> Thoughts? >> >> Thanks, >> >> -- >> Raul >> ---------------------------------------------------------------------- >> 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
