bdiv_s64.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. type
  2. { TSInt64Bit1Test }
  3. TSInt64Bit1Test = class(TSInt64DivTest)
  4. protected
  5. function GetDivisor: Int64; override;
  6. procedure DoTestIteration(Iteration: Integer); override;
  7. public
  8. function TestTitle: shortstring; override;
  9. end;
  10. { TSInt64Bit1ModTest }
  11. TSInt64Bit1ModTest = class(TSInt64ModTest)
  12. protected
  13. function GetDivisor: Int64; override;
  14. procedure DoTestIteration(Iteration: Integer); override;
  15. public
  16. function TestTitle: shortstring; override;
  17. end;
  18. { TSInt64Bit10Test }
  19. TSInt64Bit10Test = class(TSInt64DivTest)
  20. protected
  21. function GetDivisor: Int64; override;
  22. procedure DoTestIteration(Iteration: Integer); override;
  23. public
  24. function TestTitle: shortstring; override;
  25. end;
  26. { TSInt64Bit10ModTest }
  27. TSInt64Bit10ModTest = class(TSInt64ModTest)
  28. protected
  29. function GetDivisor: Int64; override;
  30. procedure DoTestIteration(Iteration: Integer); override;
  31. public
  32. function TestTitle: shortstring; override;
  33. end;
  34. { TSInt64Bit18Test }
  35. TSInt64Bit18Test = class(TSInt64DivTest)
  36. protected
  37. function GetDivisor: Int64; override;
  38. procedure DoTestIteration(Iteration: Integer); override;
  39. public
  40. function TestTitle: shortstring; override;
  41. end;
  42. { TSInt64Bit18ModTest }
  43. TSInt64Bit18ModTest = class(TSInt64ModTest)
  44. protected
  45. function GetDivisor: Int64; override;
  46. procedure DoTestIteration(Iteration: Integer); override;
  47. public
  48. function TestTitle: shortstring; override;
  49. end;
  50. { TSInt64Bit24Test }
  51. TSInt64Bit24Test = class(TSInt64DivTest)
  52. protected
  53. function GetDivisor: Int64; override;
  54. procedure DoTestIteration(Iteration: Integer); override;
  55. public
  56. function TestTitle: shortstring; override;
  57. end;
  58. { TSInt64Bit24ModTest }
  59. TSInt64Bit24ModTest = class(TSInt64ModTest)
  60. protected
  61. function GetDivisor: Int64; override;
  62. procedure DoTestIteration(Iteration: Integer); override;
  63. public
  64. function TestTitle: shortstring; override;
  65. end;
  66. { TSInt64Bit100Test }
  67. TSInt64Bit100Test = class(TSInt64DivTest)
  68. protected
  69. function GetDivisor: Int64; override;
  70. procedure DoTestIteration(Iteration: Integer); override;
  71. public
  72. function TestTitle: shortstring; override;
  73. end;
  74. { TSInt64Bit100ModTest }
  75. TSInt64Bit100ModTest = class(TSInt64ModTest)
  76. protected
  77. function GetDivisor: Int64; override;
  78. procedure DoTestIteration(Iteration: Integer); override;
  79. public
  80. function TestTitle: shortstring; override;
  81. end;
  82. { TSInt64Bit153Test }
  83. const
  84. FS64_153Input: array[$0..$F] of Int64 =
  85. (0, 1, 152, 153, 154, -1, -152, -153, -154,
  86. 8000000000000000117, 8000000000000000118, 8000000000000000119,
  87. -8000000000000000117, -8000000000000000118, -8000000000000000119,
  88. Int64($8000000000000000));
  89. type
  90. TSInt64Bit153Test = class(TSInt64DivTest)
  91. protected
  92. function GetDivisor: Int64; override;
  93. procedure DoTestIteration(Iteration: Integer); override;
  94. public
  95. function TestTitle: shortstring; override;
  96. end;
  97. { TSInt64Bit153ModTest }
  98. TSInt64Bit153ModTest = class(TSInt64ModTest)
  99. protected
  100. function GetDivisor: Int64; override;
  101. procedure DoTestIteration(Iteration: Integer); override;
  102. public
  103. function TestTitle: shortstring; override;
  104. end;
  105. { TSInt64Bit1461Test }
  106. const
  107. FS64_1461Input: array[$0..$F] of Int64 =
  108. (0, 1, 1460, 1461, 1462, -1, -1460, -1461, -1462,
  109. 8000000000000000582, 8000000000000000583, 8000000000000000584,
  110. -8000000000000000582, -8000000000000000583, -8000000000000000584,
  111. Int64($8000000000000000));
  112. type
  113. TSInt64Bit1461Test = class(TSInt64DivTest)
  114. protected
  115. function GetDivisor: Int64; override;
  116. procedure DoTestIteration(Iteration: Integer); override;
  117. public
  118. function TestTitle: shortstring; override;
  119. end;
  120. { TSInt64Bit1461ModTest }
  121. TSInt64Bit1461ModTest = class(TSInt64ModTest)
  122. protected
  123. function GetDivisor: Int64; override;
  124. procedure DoTestIteration(Iteration: Integer); override;
  125. public
  126. function TestTitle: shortstring; override;
  127. end;
  128. { TSInt64Bit10000Test }
  129. const
  130. FS64_10000Input: array[$0..$F] of Int64 =
  131. (0, 1, 9999, 10000, 10001, -1, -9999, -10000, -10001,
  132. 7999999999999999999, 8000000000000000000, 8000000000000000001,
  133. -7999999999999999999, -8000000000000000000, -8000000000000000001,
  134. Int64($8000000000000000));
  135. type
  136. TSInt64Bit10000Test = class(TSInt64DivTest)
  137. protected
  138. function GetDivisor: Int64; override;
  139. procedure DoTestIteration(Iteration: Integer); override;
  140. public
  141. function TestTitle: shortstring; override;
  142. end;
  143. { TSInt64Bit10000ModTest }
  144. TSInt64Bit10000ModTest = class(TSInt64ModTest)
  145. protected
  146. function GetDivisor: Int64; override;
  147. procedure DoTestIteration(Iteration: Integer); override;
  148. public
  149. function TestTitle: shortstring; override;
  150. end;
  151. { TSInt64Bit86400000Test }
  152. const
  153. FS64_86400000Input: array[$0..$F] of Int64 =
  154. (0, 1, 86399999, 86400000, 86400001, -1, -86399999, -86400000, -86400001,
  155. 8639999999999999999, 8640000000000000000, 8640000000000000001,
  156. -8639999999999999999, -8640000000000000000, -8640000000000000001,
  157. Int64($8000000000000000));
  158. type
  159. TSInt64Bit86400000Test = class(TSInt64DivTest)
  160. protected
  161. function GetDivisor: Int64; override;
  162. procedure DoTestIteration(Iteration: Integer); override;
  163. public
  164. function TestTitle: shortstring; override;
  165. end;
  166. { TSInt64Bit86400000ModTest }
  167. TSInt64Bit86400000ModTest = class(TSInt64ModTest)
  168. protected
  169. function GetDivisor: Int64; override;
  170. procedure DoTestIteration(Iteration: Integer); override;
  171. public
  172. function TestTitle: shortstring; override;
  173. end;
  174. { TSInt64Bit1Test }
  175. function TSInt64Bit1Test.TestTitle: shortstring;
  176. begin
  177. Result := 'Signed 64-bit division by 1';
  178. end;
  179. function TSInt64Bit1Test.GetDivisor: Int64;
  180. begin
  181. Result := 1;
  182. end;
  183. procedure TSInt64Bit1Test.DoTestIteration(Iteration: Integer);
  184. var
  185. Numerator, Answer: Int64;
  186. Index, X: Integer;
  187. begin
  188. Index := Iteration and $FF;
  189. case Index of
  190. 0:
  191. Numerator := Int64($8000000000000000);
  192. 1:
  193. Numerator := Int64($8000000000000006);
  194. 2:
  195. Numerator := Int64($8000000000000007);
  196. 253:
  197. Numerator := Int64($7FFFFFFFFFFFFFF9);
  198. 254:
  199. Numerator := Int64($7FFFFFFFFFFFFFFA);
  200. 255:
  201. Numerator := Int64($7FFFFFFFFFFFFFFF);
  202. else
  203. Numerator := Index - 128;
  204. end;
  205. FInputArray[Index] := Numerator;
  206. for X := 0 to INTERNAL_LOOPS - 1 do
  207. Answer := Numerator div 1;
  208. FResultArray[Index] := Answer;
  209. end;
  210. { TSInt64Bit1ModTest }
  211. function TSInt64Bit1ModTest.TestTitle: shortstring;
  212. begin
  213. Result := 'Signed 64-bit modulus by 1';
  214. end;
  215. function TSInt64Bit1ModTest.GetDivisor: Int64;
  216. begin
  217. Result := 1;
  218. end;
  219. procedure TSInt64Bit1ModTest.DoTestIteration(Iteration: Integer);
  220. var
  221. Numerator, Answer: Int64;
  222. Index, X: Integer;
  223. begin
  224. Index := Iteration and $FF;
  225. case Index of
  226. 0:
  227. Numerator := Int64($8000000000000000);
  228. 1:
  229. Numerator := Int64($8000000000000006);
  230. 2:
  231. Numerator := Int64($8000000000000007);
  232. 253:
  233. Numerator := Int64($7FFFFFFFFFFFFFF9);
  234. 254:
  235. Numerator := Int64($7FFFFFFFFFFFFFFA);
  236. 255:
  237. Numerator := Int64($7FFFFFFFFFFFFFFF);
  238. else
  239. Numerator := Index - 128;
  240. end;
  241. FInputArray[Index] := Numerator;
  242. for X := 0 to INTERNAL_LOOPS - 1 do
  243. Answer := Numerator mod 1;
  244. FResultArray[Index] := Answer;
  245. end;
  246. { TSInt64Bit10Test }
  247. function TSInt64Bit10Test.TestTitle: shortstring;
  248. begin
  249. Result := 'Signed 64-bit division by 10';
  250. end;
  251. function TSInt64Bit10Test.GetDivisor: Int64;
  252. begin
  253. Result := 10;
  254. end;
  255. procedure TSInt64Bit10Test.DoTestIteration(Iteration: Integer);
  256. var
  257. Numerator, Answer: Int64;
  258. Index, X: Integer;
  259. begin
  260. Index := Iteration and $FF;
  261. case Index of
  262. 0:
  263. Numerator := Int64($8000000000000000);
  264. 1:
  265. Numerator := Int64($8000000000000006);
  266. 2:
  267. Numerator := Int64($8000000000000007);
  268. 253:
  269. Numerator := Int64($7FFFFFFFFFFFFFF9);
  270. 254:
  271. Numerator := Int64($7FFFFFFFFFFFFFFA);
  272. 255:
  273. Numerator := Int64($7FFFFFFFFFFFFFFF);
  274. else
  275. Numerator := Index - 128;
  276. end;
  277. FInputArray[Index] := Numerator;
  278. for X := 0 to INTERNAL_LOOPS - 1 do
  279. Answer := Numerator div 10;
  280. FResultArray[Index] := Answer;
  281. end;
  282. { TSInt64Bit10ModTest }
  283. function TSInt64Bit10ModTest.TestTitle: shortstring;
  284. begin
  285. Result := 'Signed 64-bit modulus by 10';
  286. end;
  287. function TSInt64Bit10ModTest.GetDivisor: Int64;
  288. begin
  289. Result := 10;
  290. end;
  291. procedure TSInt64Bit10ModTest.DoTestIteration(Iteration: Integer);
  292. var
  293. Numerator, Answer: Int64;
  294. Index, X: Integer;
  295. begin
  296. Index := Iteration and $FF;
  297. case Index of
  298. 0:
  299. Numerator := Int64($8000000000000000);
  300. 1:
  301. Numerator := Int64($8000000000000006);
  302. 2:
  303. Numerator := Int64($8000000000000007);
  304. 253:
  305. Numerator := Int64($7FFFFFFFFFFFFFF9);
  306. 254:
  307. Numerator := Int64($7FFFFFFFFFFFFFFA);
  308. 255:
  309. Numerator := Int64($7FFFFFFFFFFFFFFF);
  310. else
  311. Numerator := Index - 128;
  312. end;
  313. FInputArray[Index] := Numerator;
  314. for X := 0 to INTERNAL_LOOPS - 1 do
  315. Answer := Numerator mod 10;
  316. FResultArray[Index] := Answer;
  317. end;
  318. { TSInt64Bit18Test }
  319. function TSInt64Bit18Test.TestTitle: shortstring;
  320. begin
  321. Result := 'Signed 64-bit division by 18';
  322. end;
  323. function TSInt64Bit18Test.GetDivisor: Int64;
  324. begin
  325. Result := 18;
  326. end;
  327. procedure TSInt64Bit18Test.DoTestIteration(Iteration: Integer);
  328. var
  329. Numerator, Answer: Int64;
  330. Index, X: Integer;
  331. begin
  332. Index := Iteration and $FF;
  333. Numerator := Index - 128;
  334. FInputArray[Index] := Numerator;
  335. for X := 0 to INTERNAL_LOOPS - 1 do
  336. Answer := Numerator div 18;
  337. FResultArray[Index] := Answer;
  338. end;
  339. { TSInt64Bit18ModTest }
  340. function TSInt64Bit18ModTest.TestTitle: shortstring;
  341. begin
  342. Result := 'Signed 64-bit modulus by 18';
  343. end;
  344. function TSInt64Bit18ModTest.GetDivisor: Int64;
  345. begin
  346. Result := 18;
  347. end;
  348. procedure TSInt64Bit18ModTest.DoTestIteration(Iteration: Integer);
  349. var
  350. Numerator, Answer: Int64;
  351. Index, X: Integer;
  352. begin
  353. Index := Iteration and $FF;
  354. Numerator := Index - 128;
  355. FInputArray[Index] := Numerator;
  356. for X := 0 to INTERNAL_LOOPS - 1 do
  357. Answer := Numerator mod 18;
  358. FResultArray[Index] := Answer;
  359. end;
  360. { TSInt64Bit24Test }
  361. function TSInt64Bit24Test.TestTitle: shortstring;
  362. begin
  363. Result := 'Signed 64-bit division by 24';
  364. end;
  365. function TSInt64Bit24Test.GetDivisor: Int64;
  366. begin
  367. Result := 24;
  368. end;
  369. procedure TSInt64Bit24Test.DoTestIteration(Iteration: Integer);
  370. var
  371. Numerator, Answer: Int64;
  372. Index, X: Integer;
  373. begin
  374. Index := Iteration and $FF;
  375. Numerator := Index - 128;
  376. FInputArray[Index] := Numerator;
  377. for X := 0 to INTERNAL_LOOPS - 1 do
  378. Answer := Numerator div 24;
  379. FResultArray[Index] := Answer;
  380. end;
  381. { TSInt64Bit24ModTest }
  382. function TSInt64Bit24ModTest.TestTitle: shortstring;
  383. begin
  384. Result := 'Signed 64-bit modulus by 24';
  385. end;
  386. function TSInt64Bit24ModTest.GetDivisor: Int64;
  387. begin
  388. Result := 24;
  389. end;
  390. procedure TSInt64Bit24ModTest.DoTestIteration(Iteration: Integer);
  391. var
  392. Numerator, Answer: Int64;
  393. Index, X: Integer;
  394. begin
  395. Index := Iteration and $FF;
  396. Numerator := Index - 128;
  397. FInputArray[Index] := Numerator;
  398. for X := 0 to INTERNAL_LOOPS - 1 do
  399. Answer := Numerator mod 24;
  400. FResultArray[Index] := Answer;
  401. end;
  402. { TSInt64Bit100Test }
  403. function TSInt64Bit100Test.TestTitle: shortstring;
  404. begin
  405. Result := 'Signed 64-bit division by 100';
  406. end;
  407. function TSInt64Bit100Test.GetDivisor: Int64;
  408. begin
  409. Result := 100;
  410. end;
  411. procedure TSInt64Bit100Test.DoTestIteration(Iteration: Integer);
  412. var
  413. Numerator, Answer: Int64;
  414. Index, X: Integer;
  415. begin
  416. Index := Iteration and $FF;
  417. case Index of
  418. 0:
  419. Numerator := Int64($8000000000000000);
  420. 1:
  421. Numerator := Int64($8000000000000008);
  422. 2:
  423. Numerator := Int64($8000000000000009);
  424. 253:
  425. Numerator := Int64($7FFFFFFFFFFFFFF7);
  426. 254:
  427. Numerator := Int64($7FFFFFFFFFFFFFF8);
  428. 255:
  429. Numerator := Int64($7FFFFFFFFFFFFFFF);
  430. else
  431. Numerator := Index - 128;
  432. end;
  433. FInputArray[Index] := Numerator;
  434. for X := 0 to INTERNAL_LOOPS - 1 do
  435. Answer := Numerator div 100;
  436. FResultArray[Index] := Answer;
  437. end;
  438. { TSInt64Bit100ModTest }
  439. function TSInt64Bit100ModTest.TestTitle: shortstring;
  440. begin
  441. Result := 'Signed 64-bit modulus by 100';
  442. end;
  443. function TSInt64Bit100ModTest.GetDivisor: Int64;
  444. begin
  445. Result := 100;
  446. end;
  447. procedure TSInt64Bit100ModTest.DoTestIteration(Iteration: Integer);
  448. var
  449. Numerator, Answer: Int64;
  450. Index, X: Integer;
  451. begin
  452. Index := Iteration and $FF;
  453. case Index of
  454. 0:
  455. Numerator := Int64($8000000000000000);
  456. 1:
  457. Numerator := Int64($8000000000000008);
  458. 2:
  459. Numerator := Int64($8000000000000009);
  460. 253:
  461. Numerator := Int64($7FFFFFFFFFFFFFF7);
  462. 254:
  463. Numerator := Int64($7FFFFFFFFFFFFFF8);
  464. 255:
  465. Numerator := Int64($7FFFFFFFFFFFFFFF);
  466. else
  467. Numerator := Index - 128;
  468. end;
  469. FInputArray[Index] := Numerator;
  470. for X := 0 to INTERNAL_LOOPS - 1 do
  471. Answer := Numerator mod 100;
  472. FResultArray[Index] := Answer;
  473. end;
  474. { TSInt64Bit153Test }
  475. function TSInt64Bit153Test.TestTitle: shortstring;
  476. begin
  477. Result := 'Signed 64-bit division by 153';
  478. end;
  479. function TSInt64Bit153Test.GetDivisor: Int64;
  480. begin
  481. Result := 153;
  482. end;
  483. procedure TSInt64Bit153Test.DoTestIteration(Iteration: Integer);
  484. var
  485. Numerator, Answer: Int64;
  486. Index, X: Integer;
  487. begin
  488. Index := Iteration and $FF;
  489. Numerator := FS64_153Input[Index and $F];
  490. FInputArray[Index] := Numerator;
  491. for X := 0 to INTERNAL_LOOPS - 1 do
  492. Answer := Numerator div 153;
  493. FResultArray[Index] := Answer;
  494. end;
  495. { TSInt64Bit153ModTest }
  496. function TSInt64Bit153ModTest.TestTitle: shortstring;
  497. begin
  498. Result := 'Signed 64-bit modulus by 153';
  499. end;
  500. function TSInt64Bit153ModTest.GetDivisor: Int64;
  501. begin
  502. Result := 153;
  503. end;
  504. procedure TSInt64Bit153ModTest.DoTestIteration(Iteration: Integer);
  505. var
  506. Numerator, Answer: Int64;
  507. Index, X: Integer;
  508. begin
  509. Index := Iteration and $FF;
  510. Numerator := FS64_153Input[Index and $F];
  511. FInputArray[Index] := Numerator;
  512. for X := 0 to INTERNAL_LOOPS - 1 do
  513. Answer := Numerator mod 153;
  514. FResultArray[Index] := Answer;
  515. end;
  516. { TSInt64Bit1461Test }
  517. function TSInt64Bit1461Test.TestTitle: shortstring;
  518. begin
  519. Result := 'Signed 64-bit division by 1,461';
  520. end;
  521. function TSInt64Bit1461Test.GetDivisor: Int64;
  522. begin
  523. Result := 1461;
  524. end;
  525. procedure TSInt64Bit1461Test.DoTestIteration(Iteration: Integer);
  526. var
  527. Numerator, Answer: Int64;
  528. Index, X: Integer;
  529. begin
  530. Index := Iteration and $FF;
  531. Numerator := FS64_1461Input[Index and $F];
  532. FInputArray[Index] := Numerator;
  533. for X := 0 to INTERNAL_LOOPS - 1 do
  534. Answer := Numerator div 1461;
  535. FResultArray[Index] := Answer;
  536. end;
  537. { TSInt64Bit1461ModTest }
  538. function TSInt64Bit1461ModTest.TestTitle: shortstring;
  539. begin
  540. Result := 'Signed 64-bit modulus by 1,461';
  541. end;
  542. function TSInt64Bit1461ModTest.GetDivisor: Int64;
  543. begin
  544. Result := 1461;
  545. end;
  546. procedure TSInt64Bit1461ModTest.DoTestIteration(Iteration: Integer);
  547. var
  548. Numerator, Answer: Int64;
  549. Index, X: Integer;
  550. begin
  551. Index := Iteration and $FF;
  552. Numerator := FS64_1461Input[Index and $F];
  553. FInputArray[Index] := Numerator;
  554. for X := 0 to INTERNAL_LOOPS - 1 do
  555. Answer := Numerator mod 1461;
  556. FResultArray[Index] := Answer;
  557. end;
  558. { TSInt64Bit10000Test }
  559. function TSInt64Bit10000Test.TestTitle: shortstring;
  560. begin
  561. Result := 'Signed 64-bit division by 10,000 (Currency)';
  562. end;
  563. function TSInt64Bit10000Test.GetDivisor: Int64;
  564. begin
  565. Result := 10000;
  566. end;
  567. procedure TSInt64Bit10000Test.DoTestIteration(Iteration: Integer);
  568. var
  569. Numerator, Answer: Int64;
  570. Index, X: Integer;
  571. begin
  572. Index := Iteration and $FF;
  573. Numerator := FS64_10000Input[Index and $F];
  574. FInputArray[Index] := Numerator;
  575. for X := 0 to INTERNAL_LOOPS - 1 do
  576. Answer := Numerator div 10000;
  577. FResultArray[Index] := Answer;
  578. end;
  579. { TSInt64Bit10000ModTest }
  580. function TSInt64Bit10000ModTest.TestTitle: shortstring;
  581. begin
  582. Result := 'Signed 64-bit modulus by 10,000 (Currency)';
  583. end;
  584. function TSInt64Bit10000ModTest.GetDivisor: Int64;
  585. begin
  586. Result := 10000;
  587. end;
  588. procedure TSInt64Bit10000ModTest.DoTestIteration(Iteration: Integer);
  589. var
  590. Numerator, Answer: Int64;
  591. Index, X: Integer;
  592. begin
  593. Index := Iteration and $FF;
  594. Numerator := FS64_10000Input[Index and $F];
  595. FInputArray[Index] := Numerator;
  596. for X := 0 to INTERNAL_LOOPS - 1 do
  597. Answer := Numerator mod 10000;
  598. FResultArray[Index] := Answer;
  599. end;
  600. { TSInt64Bit86400000Test }
  601. function TSInt64Bit86400000Test.TestTitle: shortstring;
  602. begin
  603. Result := 'Signed 64-bit division by 86,400,000';
  604. end;
  605. function TSInt64Bit86400000Test.GetDivisor: Int64;
  606. begin
  607. Result := 86400000;
  608. end;
  609. procedure TSInt64Bit86400000Test.DoTestIteration(Iteration: Integer);
  610. var
  611. Numerator, Answer: Int64;
  612. Index, X: Integer;
  613. begin
  614. Index := Iteration and $FF;
  615. Numerator := FS64_86400000Input[Index and $F];
  616. FInputArray[Index] := Numerator;
  617. for X := 0 to INTERNAL_LOOPS - 1 do
  618. Answer := Numerator div 86400000;
  619. FResultArray[Index] := Answer;
  620. end;
  621. { TSInt64Bit86400000ModTest }
  622. function TSInt64Bit86400000ModTest.TestTitle: shortstring;
  623. begin
  624. Result := 'Signed 64-bit modulus by 86,400,000';
  625. end;
  626. function TSInt64Bit86400000ModTest.GetDivisor: Int64;
  627. begin
  628. Result := 86400000;
  629. end;
  630. procedure TSInt64Bit86400000ModTest.DoTestIteration(Iteration: Integer);
  631. var
  632. Numerator, Answer: Int64;
  633. Index, X: Integer;
  634. begin
  635. Index := Iteration and $FF;
  636. Numerator := FS64_86400000Input[Index and $F];
  637. FInputArray[Index] := Numerator;
  638. for X := 0 to INTERNAL_LOOPS - 1 do
  639. Answer := Numerator mod 86400000;
  640. FResultArray[Index] := Answer;
  641. end;