const square = (n: number) => { n = Math.abs(n); while(true) { const result = Math.random() * Number.MAX_SAFE_INTEGER; if(result % n === 0) { let c = result; let d = 0; while(true) { c -= n; d++; if(c === 0) break; } if(d === n) return result; } } }
DISCLAIMER This for all I know may crash the browser tab it's running in.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
DISCLAIMER
This for all I know may crash the browser tab it's running in.