About four houses

xiaoxiao2021-03-06  84

rounding

(Turn http://www.nssoft.net/showdoc.asp?did=267) Keywords: round

Delphi's round-roofed function Round, for xxx.5, the integer part is an odd number, then Round Up, even the number Round Down, for example: x: = round (17.5) = x = 18 x: = round (12.5) = x = 12 using the following function instead Round: function DoRound (Value: Extended): Int64; procedure Set8087CW (NewCW: Word); asm MOV Default8087CW, AX FNCLEX FLDCW Default8087CW end; const RoundUpCW = $ 1B32; var OldCW: Word; begin Oldcw: = default8087cw; try set8087cw (Roundupcw); result: = round (value); Finally set8087cw (oldcw); end;

转载请注明原文地址:https://www.9cbs.com/read-94812.html

New Post(0)