Timeline for Approximate My Squares
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 17, 2020 at 9:04 | history | edited | CommunityBot |
Commonmark migration
|
|
Oct 31, 2017 at 12:14 | history | edited | Robert Benson | CC BY-SA 3.0 |
Still more golfing
|
Oct 31, 2017 at 12:10 | comment | added | Robert Benson |
The comment is fine. I knew about printf but had been using sprintf recently which does require the parentheses. I didn't think about simplifying the expression. I like the "\n" for the multiple inputs, but you're right, 2 bytes is 2 bytes.
|
|
Oct 31, 2017 at 12:07 | history | edited | Robert Benson | CC BY-SA 3.0 |
More golfing
|
Oct 31, 2017 at 0:18 | comment | added | Cabbie407 |
You're welcome. Some other things: you don't need the \n to get the output, the printf in awk doesn't need parentheses and the formula can be shortened to s/2+$1/s/2 , which results in {s=int($1^.5);printf"%.2f",s/2+$1/s/2} . Sorry if this comment seems rude.
|
|
Oct 30, 2017 at 13:54 | history | edited | Robert Benson | CC BY-SA 3.0 |
Fixing TIO links
|
Oct 30, 2017 at 13:52 | comment | added | Robert Benson | Thanks @Cabbie407 don't know why I didn't think of that. | |
Oct 29, 2017 at 22:42 | comment | added | Cabbie407 |
instead of sqrt($1) you can use $1^.5
|
|
Oct 28, 2017 at 13:19 | comment | added | Robert Benson | 'AWK' puns are fun :) | |
Oct 27, 2017 at 19:17 | comment | added | Stan Strum | well you could say this is AWKward. I’ll show myself out. edit: originally I planned for the question to shun using sqrt, but there’s too many answers and I’ll get tort if I change it so my original idea works. | |
Oct 27, 2017 at 16:33 | history | answered | Robert Benson | CC BY-SA 3.0 |