<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AFpart</id>
	<title>TI-BASIC:Fpart - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3AFpart"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Fpart&amp;action=history"/>
	<updated>2026-07-08T07:54:01Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Fpart&amp;diff=535&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Fpart&amp;diff=535&amp;oldid=prev"/>
		<updated>2016-02-24T18:06:11Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:TI-BASIC:Command&lt;br /&gt;
|picture=FPART.GIF&lt;br /&gt;
|summary=Returns the fractional part of a value.&lt;br /&gt;
|syntax=fPart(&amp;#039;&amp;#039;value&amp;#039;&amp;#039;)&lt;br /&gt;
|location=Press:&lt;br /&gt;
# MATH to access the [[TI-BASIC:Math|Math]] menu.&lt;br /&gt;
# RIGHT to access the NUM submenu.&lt;br /&gt;
# 4 to select fPart(, or use arrows.&lt;br /&gt;
|compatibility=TI-83/84/+/SE&lt;br /&gt;
|size=1 byte&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
fPart(&amp;#039;&amp;#039;value&amp;#039;&amp;#039;) returns the fractional part of &amp;#039;&amp;#039;value&amp;#039;&amp;#039;. Also works on complex numbers, lists and matrices.&lt;br /&gt;
&lt;br /&gt;
 fPart(5.32)&lt;br /&gt;
              .32&lt;br /&gt;
 fPart(4/5)&lt;br /&gt;
               .8&lt;br /&gt;
 fPart(‾5.32)&lt;br /&gt;
              ‾.32&lt;br /&gt;
 fPart(‾4/5)&lt;br /&gt;
               ‾.8&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
fPart(, along with [[TI-BASIC:Int|Int(]] or [[TI-BASIC:Ipart|IPart(]], can be used for integer [[TI-BASIC:Compression|Compression]].&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
Also, fPart( is an easy way to find A mod B (the positive remainder when A is divided by B). &lt;br /&gt;
&lt;br /&gt;
 :B(A&amp;lt;0)+iPart(BfPart(A/B))&lt;br /&gt;
&lt;br /&gt;
If A is guaranteed to be positive, the following shorter code can be used, omitting B(A&amp;lt;0):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 :iPart(BfPart(A/B))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
------&lt;br /&gt;
&lt;br /&gt;
Finally, the easiest way to check if a number is a whole number is not(fPart(X:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 :If not(fPart(X:Then&lt;br /&gt;
 : // X is an integer&lt;br /&gt;
 :Else&lt;br /&gt;
 : // X is not an integer&lt;br /&gt;
 :End&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use this, 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 when you want to find the [[TI-BASIC:Factorization|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. Example: if you store 1/3 as X and then do fpart(3x) it 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. &lt;br /&gt;
&lt;br /&gt;
= Optimization =&lt;br /&gt;
&lt;br /&gt;
Often you want to find the value of a-1 mod b -- this occurs, for example, in movement routines with wraparound. However, the problem is that if a=0, a-1 will be negative. Rather than use the longer version of the modulo routine, you might replace subtracting 1 with adding (b-1). This will have the same result, but without sign problems.&lt;br /&gt;
&lt;br /&gt;
= Related Commands =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Int|Int(]]&lt;br /&gt;
* [[TI-BASIC:Ipart|IPart(]]&lt;br /&gt;
* [[TI-BASIC:Round|Round(]]&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Compression|Compression]]&lt;br /&gt;
* [[TI-BASIC:Factorization|Number Factorization]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>