Sign in Join
Wiki copytemporary

Round/eo

Deutsch · English · Esperanto · Suomi · Русский

La RTL Systema unuo enhavas funkcion Round, kiu rondigas Real-tipan valoron al Entjera-tipa valoro. Ĝia eniga parametro estas esprimo kaj Round revenigos Int64 valoron kiu estas la valoro de la enigo rondigita al la plej proksima entjero. Se la enigo estas ekzakte meze de la du entjeroj - N.5 - tiam "rondigo de bakisto" estas uzata, kies rezulto estas la plej proksima para nombro.

Deklaro

pascal
function Round(X: Real): int64;

Ekzemplo de Uzado

pascal
begin
   WriteLn( Round(8.7) );
   WriteLn( Round(8.3) );
   // examples of "bankers rounding" - .5 is adjusted to the nearest even number
   WriteLn( Round(2.5) );
   WriteLn( Round(3.5) );
end.

Output

text
 9
 8
 2
 4

See also


From the Free Pascal wiki, page "Round/eo", as it stood on 2022-08-06 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.