GInearest - Maple Help

GaussInt

 GInearest
 the nearest Gaussian integer to a complex number

 Calling Sequence GInearest(c)

Parameters

 c - complex number

Description

 • The GInearest function returns the nearest Gaussian integer a to the given complex number c, that is, it finds a Gaussian integer a such that the distance between c and a is smallest.
 • In special cases when there are more than one possible values of a, the one with the smallest norm is chosen.

Examples

 > $\mathrm{with}\left(\mathrm{GaussInt}\right):$
 > $\mathrm{GInearest}\left(3+7I\right)$
 ${3}{+}{7}{}{I}$ (1)
 > $\mathrm{GInearest}\left(\mathrm{sqrt}\left(-1-\mathrm{sqrt}\left(2\right)\right)\right)$
 ${2}{}{I}$ (2)