Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double.NaN as Long #25

Open
masanorihirano opened this issue Jan 28, 2018 · 0 comments
Open

Double.NaN as Long #25

masanorihirano opened this issue Jan 28, 2018 · 0 comments

Comments

@masanorihirano
Copy link

I think the cast from double to long is weird.

import x10.io.Console;

class test {
  public static def main(args:Rail[String]):void {
    Console.OUT.print(Double.NaN as Long);
  }
}

compile the code above and carry it out, it work weirdly.

x10c++ test.x10
./a.out

we can get the result below

-9223372036854775808

On the other hand,

x10c test.x10
x10 test

we can get the result below, which is completely different from above

0

I supposed that I can get "NaN" put into Long as the result.

Is the result above correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant