User talk:Waldorf: Difference between revisions

(New section: Lucas-Lehmer test)
(→‎Primitive types: new section)
 
(4 intermediate revisions by 3 users not shown)
Line 21:
To (in hybrid Ada/C at least):
MP : Long_Long_Integer := 2ULL**Item - 1;
(esp if the bit width on Int is ≤ ¼ of Long_Long_Integer's width)
 
The logic is Lucas-Lehmer should be generate n in 2*n-1 where n is
Cheers [[User:NevilleDNZ|NevilleDNZ]] 02:50, 16 February 2008 (MST)
"almost" half the bit width of Long_Long_Integer. If this width is
128, then n should get to:
M2 M3 M5 M7 M13 M17 M19 M31 M61
Unsigned also help get to M127 if Long_Long_Integer is 32 bytes wide,
if there is such a thing.
 
Cheers [[User:NevilleDNZ|NevilleDNZ]] 02:5059, 16 February 2008 (MST)
:I gather from your example above that you are suggesting the use of an unsigned integer type. I use a Windows XP OS. The largest unsigned number available to me on my Ada compiler is a 64 bit unsigned number, which yields the same result.--[[User:Waldorf|Waldorf]] 07:02, 16 February 2008 (MST)
 
== [[Monty Hall simulation]] results ==
Hi, Your sample results could be in error could you take a look at the comment in the MH talk page please, thanks. --[[User:Paddy3118|Paddy3118]] 15:24, 11 August 2008 (UTC)
:The problem was handled by increasing the number of iterations. The discrete random number generator in the GNAT compiler is flaky for small numbers of runs.--[[User:Waldorf|Waldorf]] 00:22, 15 August 2008 (UTC)
 
== Primitive types ==
 
There's some interest in the intention behind [[Talk:Defining Primitive Data Types|Defining Primitive Types]], if you can take a moment to weigh in. --[[User:Short Circuit|Short Circuit]] 02:53, 2 March 2009 (UTC)