From: Phoenix on
On 7 Jun, 12:34, Noob <r...(a)127.0.0.1> wrote:
> Phoenix wrote:
> > The incompatibility between i.e. (Intel/SUN) communications, is for
> > all areas (Chemistry, Trigonometry, Biology, Geometry, etc) or only
> > for crypto?
> > If answer is only for crypto, what is the solution to pass accurate
> > and compatible values in R from one system to another?
>
> You might be interested in reading Goldberg's famous paper.
>
> What Every Computer Scientist Should Know About Floating-Point Arithmetichttp://docs.sun.com/source/806-3568/ncg_goldberg.html
>
> Regards.

Noob, thank you for that. Is a great job.
I will read it later.


From: Tom St Denis on
On Jun 7, 7:29 am, Phoenix <ribeiroa...(a)gmail.com> wrote:
> On 7 Jun, 11:54, Tom St Denis <t...(a)iahu.ca> wrote:
>
> > > Why integers are uniformly distributed and fp not?
>
> > Because some fractions are not easily representable in 2-adic terms.
>
> > Tom
>
> Well, with that assumption, we never have uniformly distribution in
> (0;1).

Bingo.

Tom
From: Phoenix on

I have this javascipt code that generate 1000 pseudo random numbers
(0;1)

<SCRIPT LANGUAGE="Javascript">
var seed = new Date ()
var seed = seed.getTime ()
var seed = seed.toString();
var l = seed.length;
var r = ""
for (u=0; u<l; u++) {
var r = r + seed.charAt( l-u )
}
var c = (eval( "." + r )+.5)/2
c=.5
var b=0
var x=0

for (n=1; n><1001; n++) {
var b = b + 1
var x = x*(x+b)+c - Math.floor(x*(x+b)+c)
document.write( String(x).substring(0,16) + "<BR>")
}
</SCRIPT><o:p></o:p></span></p><o:p></o:p></span></p>

here:http://www.number.com.pt/randnum.html

The results are:

0.5 <=The first one
0.75
0.3125
0.84765625
0.45680236816406
0.44948261254467
0.84841290679267
..
..
..
0.21824640594169
0.35754462352170
0.81491705599194
0.08114580008782 <= The last one on 1000

With several PCs SO WindowsXP based and one MacBoock OS X, and several
browsers, (IE, Chrome, Opera, Safari, Firefox, etc) I have the same
results.

I do didn't try with LINUX or others.


From: Tom St Denis on
On Jun 7, 9:41 am, Phoenix <ribeiroa...(a)gmail.com> wrote:
> I have this javascipt code that generate 1000 pseudo random numbers
> (0;1)
>

And?

None of that changes the fact that 2-adic numbers can't represent
(0,1) fluidly (to any non-trivial level of precision).

It's easier if you used integers to say you're uniform in (0,255) or
some other power of 2 because every value is representable exactly
once.

Tom
From: Phoenix on
On 7 Jun, 15:15, Tom St Denis <t...(a)iahu.ca> wrote:
> On Jun 7, 9:41 am, Phoenix <ribeiroa...(a)gmail.com> wrote:
>
> > I have this javascipt code that generate 1000 pseudo random numbers
> > (0;1)
>
> And?
>
> None of that changes the fact that 2-adic numbers can't represent
> (0,1) fluidly (to any non-trivial level of precision).
>
> It's easier if you used integers to say you're uniform in (0,255) or
> some other power of 2 because every value is representable exactly
> once.
>
> Tom

My previus post, is for the question: portability/non portability on
fp numbers.
If all hardwere/software reproduce the same results (if), then we have
portability and every value is representable exactly
once.