Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If group operation is multiplication then if n is the highest bit, then r1=1/power(2,n-1) is the least decimal that you can operate and the set [r1,2 * r1,4 * r1,8 * r1...1] union [-r1, -2 * r1, -4 * r1,....-1] union [0] will be the group that you are expecting. For integer [1,0,-1] is the group. </p> <p>if Group operation can be any thing else, then to form n set of valid groups,</p> <p>A(r)=cos(2*Pi*r/n) from r=0 to n-1</p> <p>and group operation is </p> <p>COS(COSINV(A1)+COSINV(A2))</p> <p>I don't know whether you want this.....</p> <p>or if you want INFINITY set as a valid group then</p> <p>simple answer : GROUP OPERATION = AVG(A1,A2) = (A1+A2)/2 </p> <p>or some functions exists F which has FINV as it's inverse and then FINV(F(A1)+F(A2)/2) Example of F is Log, inverse, square etc .. </p> <pre><code> double a = drand(); while ( forever ) { double b = drand(); a = (a+b)/2 //invariant - a is a valid floating point number } </code></pre> <p>or if you want INFINITY set of DIGITAL format as a valid group then Let L be the lowest float number and H be highest float number</p> <p>then GROUP OPERATION = AVG(A1,A2, L, H) = (A1+A2+L+H)/4</p> <p>this operation will always be within L &amp; H for all Positive numbers.</p> <p>You can take L as four times the lowest decimal number and H as the (highest decimal number /4) for practical purpose.</p> <pre><code>double l = (0.0000000000000000000000000//1) * 4 double h = (0xFFFFFFFFFFFFFFFFFFFFFF///F) / 4 double a = abs(drand()) / 4; while ( forever ) { double b = abs(drand()) / 4; a = (a+b+l+h)/4 //invariant - a is a valid floating point number } </code></pre> <p>this has a subset of all possitive float number / 4.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload