Timeline for Closest fraction
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 19, 2015 at 15:50 | history | edited | Glen O | CC BY-SA 3.0 |
deleted 429 characters in body
|
Oct 11, 2014 at 19:43 | vote | accept | user2428118 | ||
Oct 11, 2014 at 19:46 | |||||
Sep 29, 2014 at 15:32 | vote | accept | user2428118 | ||
Oct 11, 2014 at 19:27 | |||||
Jun 7, 2014 at 10:03 | comment | added | user2428118 | Testing on a 64-bit computer gives the correct result, so I'm accepting this answer. | |
Jun 7, 2014 at 10:03 | vote | accept | user2428118 | ||
Sep 29, 2014 at 14:15 | |||||
Jun 2, 2014 at 20:00 | comment | added | user2428118 | Yes, I'm using a 32-bit computer. I'll try it on a 64-bit machine sometime when I've got the time for it. | |
May 22, 2014 at 10:19 | comment | added | Glen O |
If you want to ensure that the code will work for all Int64 size inputs, you can replace "int" with "int128". With that change, inputting 1234567891234567/2145768375829475878 results in 869253326028691/1510825213275018197 365314565205876/634943162554457681 . This change adds just 3 extra characters.
|
|
May 22, 2014 at 9:58 | history | edited | Glen O | CC BY-SA 3.0 |
added 52 characters in body
|
May 22, 2014 at 9:54 | comment | added | Glen O |
@user2428118 - Are you on a 32 bit system (or using a 32 bit Julia)? I've used "int", which means that on a 32 bit system, it'll use Int32 rather than Int64. int32(55552*999999) gives -282630400 . For me, with that test, I get 51143/920632 52025/936509 - note that the denominators are the same, and that 52025-51143 = 486-(-396). I'll add a note to mention this issue.
|
|
May 22, 2014 at 8:20 | comment | added | user2428118 |
Testing with 55552/999999 gives me -396/920632 486/936509 .
|
|
May 22, 2014 at 5:31 | history | edited | Glen O | CC BY-SA 3.0 |
added 244 characters in body
|
May 22, 2014 at 2:13 | review | First posts | |||
May 22, 2014 at 2:22 | |||||
May 22, 2014 at 1:55 | history | answered | Glen O | CC BY-SA 3.0 |