Skip to main content
9 of 9
added 34 characters in body
sinvec
  • 2k
  • 6
  • 28

C (gcc), 88 74 67 66 64 53 bytes

a,b;f(n){for(a=n;~a*n;b=b?--b:--a)n*=a*a+b*b!=n;a=n;}

-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using - instead of !=
-2 bytes - thanks to AZTECCO
-11 bytes - thanks to AZTECCO x2

Try it online!

sinvec
  • 2k
  • 6
  • 28