Difference between revisions of "FractionalPart Function"

From GeoGebra Manual
Jump to: navigation, search
Line 6: Line 6:
 
*<code><nowiki>fractionalPart( 1/5 + 3/2 + 2 )</nowiki></code> yields <math>\frac{7}{10}</math>.
 
*<code><nowiki>fractionalPart( 1/5 + 3/2 + 2 )</nowiki></code> yields <math>\frac{7}{10}</math>.
 
</div>}}
 
</div>}}
{{note|1=In Mathematics fractional part function is sometimes defined as <math>x-\lfloor x\rfloor </math>, in other cases as <math>sgn(x)(\mid x\mid-\lfloor \mid x\mid\rfloor </math>. 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=In Mathematics fractional part function is sometimes defined as <math>x-\lfloor x\rfloor </math>, in other cases as <math>sgn(x)(\mid x\mid-\lfloor \mid x\mid\rfloor) </math>. 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]].}}

Revision as of 13:23, 18 September 2012

fractionalPart[ <Expression> ]
Returns the fractional part of the expression.
Example:
  • fractionalPart( 6 / 5 ) yields \frac{1}{5},
  • fractionalPart( 1/5 + 3/2 + 2 ) yields \frac{7}{10}.
Note: In Mathematics fractional part function is sometimes defined 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 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