Integer Part

Author

Eric W. Weisstein
November 23, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/SpecialFunctions/IntegerPart.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/IntegerPart.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Plots

<<Utilities`Plot`

Real Axis

PlotDiscontinuous[IntegerPart[x],{x,Sequence@@DeleteCases[Range[-4,4],0]
},AxesLabel->TraditionalForm/@{x,int[x]}]

Int[x_?Positive]:=Floor[x]
Int[0]:=0
Int[x_?Negative]:=Ceiling[x]

PlotDiscontinuous[Int[x],{x,-4,4},Range[-4,4],{0}]

Int2[x_?Positive]:=Floor[x]
Int2[0]:=0
Int2[x_?Negative]:=Floor[x]+1

PlotDiscontinuous[Int2[x],{x,-4,4},Range[-4,4],{0}]

Complex Plane

ComplexPlot3D[IntegerPart[z],{z,-3,3}]//Timing

ComplexContourPlot[IntegerPart[z],{z,-3,3}]//Timing

Integer Part + Fractional Part

Plot[FractionalPart[x]+IntegerPart[x],{x,-4,4},AspectRatio->Automatic]