Timeline for It's Hip to be Square
Current License: CC BY-SA 3.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 8, 2017 at 17:01 | comment | added | ETHproductions |
@Mego But JavaScript's numbers only have 53 bits of precision, so JS cannot exactly represent the value 2**127-1 as a number. The closest it can get is 2**127 .
|
|
Jun 8, 2017 at 12:44 | history | edited | Tom | CC BY-SA 3.0 |
added 71 characters in body
|
Jun 8, 2017 at 12:38 | comment | added | Tom | @Luke That's what I was originally going to have, but Mego brought up the issue with large numbers which may or may not be correct. | |
Jun 8, 2017 at 12:33 | comment | added | Luke |
I think just ¬v1 works (0 for falsy, 1 for truthy)...
|
|
Jun 8, 2017 at 12:17 | history | edited | Tom | CC BY-SA 3.0 |
deleted 3 characters in body
|
Jun 8, 2017 at 12:10 | comment | added | Tom | @Mego Should work for everything now, will just take a very long time to run for large numbers | |
Jun 8, 2017 at 12:09 | history | undeleted | Tom | ||
Jun 8, 2017 at 12:09 | history | edited | Tom | CC BY-SA 3.0 |
added 23 characters in body
|
Jun 8, 2017 at 11:41 | history | deleted | Tom | via Vote | |
Jun 8, 2017 at 11:38 | comment | added | user45941 |
2**53-1 is the smallest value for which 1 ulp is less than or equal to 1. That's irrelevant here.
|
|
Jun 8, 2017 at 11:37 | comment | added | Tom |
@Mego Isn't the max safe int for JavaScript 2**53-1 ?
|
|
Jun 8, 2017 at 11:36 | comment | added | user45941 |
@Shaggy Japt is based on JavaScript, which uses double-precision floats. 2**127-1 is well within the range of a double.
|
|
Jun 8, 2017 at 11:36 | history | edited | Tom | CC BY-SA 3.0 |
deleted 36 characters in body
|
Jun 8, 2017 at 11:36 | comment | added | Shaggy | @Mego, isn't the norm that solutions need not handle numbers larger than the language is capable of handling? | |
Jun 8, 2017 at 11:35 | comment | added | user45941 |
Fails for large inputs (input is 2**127-1 , a Mersenne prime).
|
|
Jun 8, 2017 at 11:34 | history | edited | Tom | CC BY-SA 3.0 |
added 35 characters in body
|
Jun 8, 2017 at 11:30 | history | answered | Tom | CC BY-SA 3.0 |