Difference between revisions of "DecRet"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function DecRet(E: Extended): Extended; </source> ===Source=== <source lang="scar"> function DecRet(E: Extended): Extended; beg...")
 
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function DecRet(E: Extended): Extended;
+
function DecRet(const E: Extended): Extended;
 
</source>
 
</source>
  
 
===Source===
 
===Source===
 
<source lang="scar">
 
<source lang="scar">
function DecRet(E: Extended): Extended;
+
function DecRet(const E: Extended): Extended;
 
begin
 
begin
   Result := E - Floor(E);
+
   Result := E - Int(E);
 
end;
 
end;
 
</source>
 
</source>
Line 16: Line 16:
  
 
==Description==
 
==Description==
Returns the decimal part of an [[extended]] floating point value '''E'''.
+
Returns the decimal part of an [[extended]] floating point value '''E'''. Internally this function uses Delphi's Frac function<ref>[http://docwiki.embarcadero.com/VCL/en/System.Frac Frac in the Delphi documentation]</ref>.
  
 
==Example==
 
==Example==
Line 27: Line 27:
 
Output:
 
Output:
 
  0,11
 
  0,11
 +
 +
==References==
 +
<references>
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Math Functions]]
 
[[Category:Math Functions]]

Latest revision as of 20:00, 30 August 2011

Definition

function DecRet(const E: Extended): Extended;

Source

function DecRet(const E: Extended): Extended;
begin
  Result := E - Int(E);
end;

Availability

SCAR Divi 3.00 > Current

Description

Returns the decimal part of an extended floating point value E. Internally this function uses Delphi's Frac function[1].

Example

begin
  WriteLn(DecRet(1.11));
end.

Output:

0,11

References

<references>