Hacker News new | past | comments | ask | show | jobs | submit login
The Matter of Time() (serce.me)
54 points by wheresvic1 on June 14, 2019 | hide | past | favorite | 5 comments



> long t1 = System.currentTimeMillis();

>

> isThisPossible(t1 < 0);

> 5) No, it's not possible, at least something is not possible

Well, maybe not any time soon, but eventually (in Java at least) that will wrap around and therefor it's possible.


idk anything about Java but I imagine the spec could define this to be positive


If the spec was going to define it to be positive, the function would not return 'long', it would be unsigned long, right?


Java doesn't have unsigned integer types (except byte IIRC), so signed long is your only option. OTOH the bitwise ops are specced to operate as if they operated on twos complement represented signed integers, so you can at least do that kind of stuff if you need to, on the full 64 bits.


byte is signed, just FYI




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: