Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Tavis Ormandy Newsgroups: comp.programming Subject: Re: Getting random numbers. Date: 21 Jan 2021 15:25:48 GMT Lines: 18 Message-ID: References: <33e7892e-fe91-4440-9843-515c88da309an@googlegroups.com> X-Trace: individual.net CltycceC7U7lp9xJAbqVMwrZvgQKEyK6LfwJA+7H4dWOcxDRBH Cancel-Lock: sha1:D5ew/j/R5aDRkr8OtM1lUvj/0Q4= User-Agent: slrn/pre1.0.4-5 (Linux) Xref: csiph.com comp.programming:11867 On 2021-01-21, H E wrote: > var i01=i^1.914643966346+i^1.260774037134; I realise you're probably not going to listen to me, but it seems like you think ^ is the exponentiation operator, it's actually bitwise xor. That isn't defined for floats - so they're just truncated (that means everything after the decimal point is discarded). You can try ** or Math.pow instead, but I really think you should read about the diehard tests or TestU01 first to understand how PRNGs are evaluated. Tavis. -- _o) $ lynx lock.cmpxchg8b.com /\\ _o) _o) $ finger taviso@sdf.org _\_V _( ) _( ) @taviso