The fPart( Command

Command Summary

Returns the fractional part of a value.

Command Syntax


Menu Location


  1. MATH to access the math menu.
  2. RIGHT to access the NUM submenu.
  3. 4 to select fPart(, or use arrows.

Calculator Compatibility


Token Size

1 byte

fPart(value) returns the fractional part of value, be it a variable, list, or matrix.


Advanced Uses

fPart(, along with int( or iPart(, can be used for integer compression.

Also, fPart( is an easy way to find A mod B (the positive remainder when A is divided by B).


If A is guaranteed to be positive, the following shorter code can be used, omitting B(A<0):


Finally, the easiest way to check if a number is a whole number is not(fPart(X:

:If not(fPart(X:Then
: // X is an integer
: // X is not an integer

This can be used, for example, to check if a number is divisible by another: if X is divisible by N, then X/N is a whole number. This is useful for finding the factors of a number. Warning: when storing values with repeating decimals and later multiplying them to see if a number makes it an integer it can return a value of 1 or -1 instead of 0 even if it is an integer do rounding errors. Example: storing 1/3 to X and computingfPart(3X) will return 1 instead of 0. This is because fPart(.999…) results in .999… and then rounds to 1 when displaying rather than rounding to 1.0 and then displaying the fPart( as 0.

Related Commands

See Also


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Noncommercial 2.5 License.