TI-BASIC Wiki
Advertisement


:iPart(value)

iPart( shows the integer part of a number. It will return the same as floor( for a positive number, and ceiling( for a negative number.

fPart( returns the fractional part of a number; the part iPart( does not return. iPart(A)+fPart(A) will result in the original number.

Location[]

  • Math
  • NUM
  • 3:iPart(

Example[]

:Input "NUMBER? ",X
:If X=iPart(X)
:Then
:Disp "INTEGER"
:Else
:Disp "NOT INTEGER"
:End

This program will input a number, then determine whether it is a whole number or a decimal.

Advertisement