Toddler's Corner > Romper Room

Rand64

(1/1)

jj2007:
include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
  NanoTimer()
  fldz
  For_ ct=1 To 100000000        ; 100 Mio
        push Rand64()
        push edx
        fild qword ptr stack
        .if ct<=20
                PrintLine Str$("%i", ST(0))
        .endif
        fadd
        add esp, QWORD
  Next
  Print Str$("\n%i iterations", ct-1)
  fidivr ct
  Inkey Str$(", average: %f", ST(0)v), " generated in ", NanoTimer$()
EndOfCode


--- Code: ---8334395503510177650
1329069443230085730
2521605505399485735
-2513648910981773731
-6348034448820748366
-3307815091408750516
4066175164584430395
-3922227355712582401
428641309453789440
-8910786329316853516
-8070429261690835801
6730337785625512305
-7805041995582204841
-5974524378947664316
4637574160357525215
2695508907267694830
-7578088742529087601
8502576381148841940
-5755209493300470646
-385216518631681951
--- End code ---

--- Code: ---100000000 iterations, average: 1.298322e-15 generated in 982 ms
--- End code ---

Navigation

[0] Message Index

Go to full version