Skip to content

Double.NaN as Long #25

@masanorihirano

Description

@masanorihirano

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions