Difference between revisions of "FractionalPart Function"

From GeoGebra Manual
Jump to: navigation, search
m
 
(15 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>{{betamanual|version=4.2}}
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>  
 
{{function|fractionalPart}}
 
{{function|fractionalPart}}
;fractionalPart[ <Expression> ] :Returns the fractional part of the expression.
+
 
{{example| 1=<div>
+
;fractionalPart( <Expression> ) :Returns the fractional part of the expression.
*<code><nowiki>fractionalPart( 6 / 5 )</nowiki></code> yields <math>\frac{1}{5}</math>,
+
{{examples| 1=<div>
*<code><nowiki>fractionalPart( 1/5 + 3/2 + 2 )</nowiki></code> yields <math>\frac{7}{10}</math>.
+
*<code><nowiki>fractionalPart( 6 / 5 )</nowiki></code> yields <math>\frac{1}{5}</math> in [[File:Menu view cas.svg|link=|16px]] ''CAS View'', 0.2 in [[File:Menu view algebra.svg|link=|16px]] ''Algebra View''.
 +
*<code><nowiki>fractionalPart( 1/5 + 3/2 + 2 )</nowiki></code> yields <math>\frac{7}{10}</math> in [[File:Menu view cas.svg|link=|16px]] ''CAS View'', 0.7 in [[File:Menu view algebra.svg|link=|16px]] ''Algebra View''.
 
</div>}}
 
</div>}}
{{note|1=In Mathematics fractional part function is sometimes defined as <math>x-\lfloor x\rfloor </math>, in other cases as <nowiki><math>sgn(x)(|x|-\lfloor |x|\rfloor </math></nowiki>. GeoGebra uses the second definition (also used by Mathematica). To obtain the first function you may use <code>f(x)=x-floor(x)</code>, see  [[Predefined Functions and Operators]].}}
+
{{Note|1=<br>
 +
In Mathematics fractional part function is defined sometimes as<br>
 +
:<math>x-\lfloor x\rfloor </math><br>
 +
In other cases as<br>
 +
:<math>sgn(x)(\mid x\mid-\lfloor \mid x\mid\rfloor) </math>. <br>
 +
'''''GeoGebra''''' uses the second definition (also used by Mathematica).<br>
 +
To obtain the first function you may use '''<code>f(x) = x - floor(x)</code>'''<br>
 +
;
 +
See also [[Predefined Functions and Operators]].}}

Latest revision as of 14:39, 27 August 2015


fractionalPart( <Expression> )
Returns the fractional part of the expression.
Examples:
  • fractionalPart( 6 / 5 ) yields \frac{1}{5} in Menu view cas.svg CAS View, 0.2 in Menu view algebra.svg Algebra View.
  • fractionalPart( 1/5 + 3/2 + 2 ) yields \frac{7}{10} in Menu view cas.svg CAS View, 0.7 in Menu view algebra.svg Algebra View.
Note:

In Mathematics fractional part function is defined sometimes as

x-\lfloor x\rfloor

In other cases as

sgn(x)(\mid x\mid-\lfloor \mid x\mid\rfloor) .

GeoGebra uses the second definition (also used by Mathematica).
To obtain the first function you may use f(x) = x - floor(x)

See also Predefined Functions and Operators.

Comments

The following picture shows the two possible definitions of fractional part function, the lower one is used in GeoGebra. Fractionalpart.png

© 2024 International GeoGebra Institute