Function Resource

GaussianIntegerQ

Determines if a number is a gaussian integer, or not

ResourceFunction["GaussianIntegerQ"][z]

gives True is z is a gaussian integer and False otherwise.

Details and Options

A gaussian integer is a number whose real and imaginary parts are both integers.

Examples

Basic Examples

Zero is a gaussian integer:

In[1]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
GaussianIntegerQ"][0]
Out[1]=

Any integer is a gaussian integer:

In[2]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
GaussianIntegerQ"][42]
Out[2]=

A complex number with integer real and imaginary parts is a gaussian integer:

In[3]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
GaussianIntegerQ"][1 + I]
Out[3]=

Non-integer numbers are not gaussian integers:

In[4]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
GaussianIntegerQ"][1.2]
Out[4]=
In[5]:=
ResourceFunction[ "https://www.wolframcloud.com/obj/arnoudb/DeployedResources/Function/\
GaussianIntegerQ"][2 + \[Pi] I]
Out[5]=