1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

Frac

unit
System
category
arithmetic routines

declaration
function Frac(X: Extended): Extended

description
Returns the fractional part of a number.

Frac(X) = X - Int(X).

example
var x1,x2 : extended;
	
x1 := -2,123;
x2 := 4.987;

x1 := Frac(x1);
x2 := Frac(x2);

//x1 = -0.123
//x2 = 0.987

in real code

see also
Int,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?
Explore Delphi Programming
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2010 About.com, a part of The New York Times Company.

All rights reserved.