Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Raul Miller
That wouldn't make a lot of sense, though, for classic operations on sparse matrices (like +/ .*), would it? That said, it might sense to leave 0 as the sparse element, and then use the distinction between sparse zeros and dense zeros to track undefined values... Thanks, -- Raul On Wed, Sep 2

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Don Guinn
I thought that possibly sparse matrices might be a way to handle missing values, particularly if there a lot of undefined values. But couldn't figure out how to specify the sparse element to be _. . On Wed, Sep 20, 2017 at 3:22 PM, Henry Rich wrote: > No; see > > http://code.jsoftware.com/wiki/V

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Henry Rich
No; see http://code.jsoftware.com/wiki/Vocabulary/under Details http://code.jsoftware.com/wiki/Vocabulary/percent#dyadic Details It would perhaps be better if 0 * _5 gave -0, but it doesn't. The other deviations are improvements added by J. Henry Rich On Wed, Sep 20, 2017 at 10:51 AM, Erli

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Ric Sherlock
My memory of grappling with the "how to handle missing data" issue in APL and J was that the most complete solution was to have a separate boolean array of the same shape as the data array that identified missings. This is certainly a clunkier approach from the user's POV compared to R, but is argu

Re: [Jprogramming] Quora Challenge

2017-09-20 Thread 'Mike Day' via Programming
I'm probably missing the point,  but it's perhaps worth observing that you might choose to consider ALL the numbers here (except the exponent) as belonging to the finite field of numbers mod 13,  in which case "Roger's approach" doesn't fail. What about 10^20 ? 13&|@(10&^) 20 9 (in fact,    13&|

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Raul Miller
I do not have any problem with using _ or _. or __ as placeholders where you do not know what value to use. I do not think, however, that distinguishing between different kinds of _. values is something we should have to deal with. Thanks, -- Raul On Wed, Sep 20, 2017 at 11:04 AM, Vijay Lulla

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Joe Bogner
I've used _ and __ as placeholders for missing or invalid data. I then filter them out as needed in calculations. It's simple and has worked out fine for me. On Wed, Sep 20, 2017 at 11:22 AM, Erling Hellenäs wrote: > Hi all! > > Programs which acted on arrays containing missing data would need >

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
Hi all! Programs which acted on arrays containing missing data would need definitions which accounted for this missing data.  Take a look at R. I think most languages have ways of handling missing data, even if calculations do not always work directly on arrays containing missing data, like t

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Vijay Lulla
To answer Henry's question based on the behavior of R, which Erling advocates, and I too love!! In R, length of vector (what we'd call list in J) with missing values is still the actual number of elements in a vector. Missing value *is* still a value in a list and it gets counted! However, it ma

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
Hi all ! Here is part of the standard. Required exception handling. Things I discuss in my post. Is it implemented in J? https://en.wikipedia.org/wiki/IEEE_754#Exception_handling The floating point standard is obviously used in environments where the users can not afford random results, so the

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Henry Rich
If a list (a) can contain 'missing' entries, what does (# a) mean? What happens to mean =: +/ % # ? How is u/\. a defined? Henry Rich On Wed, Sep 20, 2017 at 10:25 AM, Erling Hellenäs wrote: > Because you possibly have an array where some cells have missing data and > you want to run your f

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
I hope others want to read my post even if Raul discards it as not worthy of comments. /Erling Den 2017-09-20 kl. 12:25, skrev Raul Miller: This isn't just J - this is the IEEE-754 floating point standard. It would be really nice if computers could deal with infinities, instantly, at no cost.

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
Because you possibly have an array where some cells have missing data and you want to run your functions directly against this array without caring about the possibly missing data. Thats how I think R works. All functions work with cells where the data is missing. Correct me if I'm wrong. R mig

Re: [Jprogramming] Quora Challenge

2017-09-20 Thread Raul Miller
Er... ok: yes, not exactly but sort of, and that depends? It's a messy subject, but switching to extended precision is a much more general approach for this kind of problem. Thanks, -- Raul On Wed, Sep 20, 2017 at 5:31 AM, Erling Hellenäs wrote: > Hi all ! > > It just surprised me that you di

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Raul Miller
Why not just use another number? Many more bits that way... Thanks, -- Raul On Wed, Sep 20, 2017 at 5:47 AM, Erling Hellenäs wrote: > Hi all ! > > "A NaN may carry a payload that is intended for diagnostic information > indicating the source of the NaN" > > https://en.wikipedia.org/wiki/IEEE_

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Raul Miller
This isn't just J - this is the IEEE-754 floating point standard. It would be really nice if computers could deal with infinities, instantly, at no cost. Sadly, though, that's not going to happen. FYI, -- Raul On Wed, Sep 20, 2017 at 5:21 AM, Erling Hellenäs wrote: > Hi all! > > This is how

Re: [Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
Hi all ! "A NaN may carry a payload that is intended for diagnostic information indicating the source of the NaN" https://en.wikipedia.org/wiki/IEEE_754#Alternate_exception_handling Maybe this is a way to represent missing data? Cheers, Erling Den 2017-09-20 kl. 11:21, skrev Erling Hellen

Re: [Jprogramming] Quora Challenge

2017-09-20 Thread Erling Hellenäs
Hi all ! It just surprised me that you didn't mention it as a possible solution to the problems of Skip Cave. Since you did not it seemed there might be a problem with this solution. It might not be a possible solution. That's why I ask these three questions. It's not because I can not read o

[Jprogramming] Overflow, underflow, floats

2017-09-20 Thread Erling Hellenäs
Hi all! This is how J handles overflow and underflow. This is exacly how the platform handles it. JWithATwist gives exactly the same results. As we can see overflow results in infinity, underflow results in a zero result.    0.1234567891234567e_15 * 0.1234567891234567e_307 0    0.123456789123