Updating this future to reflect that fact that ints/uints are now 64-bits
Updating this future to reflect that fact that ints/uints are now 64-bits

This future started passing due to the fact that it was coded assuming
32-bit integers, so started working once they became 64-bits by
default.  I changed it back to explicitly use 32-bit values to
preserve the original intent of the future.

That said, I'm not sure what the future proposes as a solution.  The
.good file suggests that abs() should return a type other than the
input type which would be a departure, but arguably we could have
abs() on integers return a uint of the input int's width.  The main
downside is that uints are such a pain to code with and in all cases
but one the input type works just fine.

Another approach would be to catch the min(int) case at runtime and
halt().

A third approach would be to have abs() take an optional type argument
that specifies the desired return type and have it default to the
input type.  This would permit someone who wanted a true abs() to
specify a larger type of their choosing and deal with the
consequences, but have it work in the typical case typically.  We do
this in some other cases and while atypical, it's actually pretty
nicely flexible, takes advantage of Chapel uniqueness (type arguments
with defaults), and most users never even know it's there.

Such an implementation could something look like this:

proc abs(x: int(?w), type retType = int(w)) {
  if (x.type == retType) then
    if (abs < 0) then
      return -x;
    else
      return x;
  else
    if (abs < 0) then
      return (-x):uint(w):retType;  // did I get that right?
    else
      return x:retType;
}

Yet another approach would be to have abs() and trueabs() or uabs() or
something where the former returns a signed int and the latter an
unsigned.


Any of these approaches seem very easy to implement, and retiring a
future would be great, so maybe we could push this through in short
order...?




git-svn-id: 88467cb1fb04b8a755be7e1ee1026be4190196ef@19836 3a8e244f-b0f2-452b-bcba-4c88e055c3ca

hildeth/chapel,sungeunchoi/chapel,hildeth/chapel,sungeunchoi/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,chizarlicious/chapel,sungeunchoi/chapel,sungeunchoi/chapel,chizarlicious/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,chizarlicious/chapel,CoryMcCartan/chapel,chizarlicious/chapel,hildeth/chapel,hildeth/chapel,chizarlicious/chapel,CoryMcCartan/chapel,hildeth/chapel,sungeunchoi/chapel,chizarlicious/chapel,sungeunchoi/chapel,hildeth/chapel,chizarlicious/chapel,sungeunchoi/chapel,CoryMcCartan/chapel,CoryMcCartan/chapel,hildeth/chapel