Skip to main content

Timeline for Square Root Distance from Integers

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Feb 28, 2019 at 4:41 history edited Gymhgy CC BY-SA 4.0
deleted 12 characters in body
Feb 26, 2019 at 15:57 history edited Gymhgy CC BY-SA 4.0
added 41 characters in body
Feb 26, 2019 at 15:56 comment added Gymhgy @KevinCruijssen Yes it can, I just forgot the n was already a double
Feb 26, 2019 at 12:59 comment added Kevin Cruijssen Also, the 0d+ can be removed, can it not?
Feb 26, 2019 at 12:39 comment added Kevin Cruijssen You can save a byte by putting the n++ in the loop, so the -1 can be removed from the return: k=>{double n=1,p;for(;Math.Abs(Math.Round(p=Math.Sqrt(0d+n))-p)>k|p%1==0;n++);return n;}
Feb 26, 2019 at 4:45 history answered Gymhgy CC BY-SA 4.0