Giter Site home page Giter Site logo

pcg_rand's People

Contributors

frostyhitoshura avatar marshallpierce avatar robojeb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pcg_rand's Issues

Port to rand_core 0.2

I'm working on updating pcg_rand to use rand_core 0.2 (which corresponds to Rand 0.5) instead of Rand 0.4. Unfortunately, I ran into a compiler bug (rust-lang/rust#43408). I'm not sure yet how to work around it.

First return from gen() on new_unseeded() is 0

Here's a program:

extern crate rand;
extern crate pcg_rand;

use rand::Rng;
use rand::XorShiftRng;
use pcg_rand::Pcg32;

pub fn main() {
    let mut xorshift = XorShiftRng::new_unseeded();
    let mut pcg = Pcg32::new_unseeded();
    let xv: u32 = xorshift.gen();
    let pv: u32 = pcg.gen();
    println!("{} {}", xv, pv);
}

And here's its output (at least on my box):

3690029583 0

While the pcg output is technically ok โ€” the generator is unseeded, and so can start the sequence where it likes โ€” I'd strongly prefer that the first output of an unseeded generator still "look random" as with xorshift. Fix should be as easy as a call to gen() inside new_unseeded().

Cannot use pcg_rand 0.9.2 without nightly

886f854 added a #![feature(tool_lints)] which requires nightly to work, making it not possible to use 0.9.2 on beta or stable

#![feature(tool_lints)]

The tool_lints warning has been canceled by rust-lang/rust#54358 on the current 1.30 beta channel, so writing #[allow(needless_pass_by_value)] should be fine.

BTW, the feature has been stabilized by rust-lang/rust#54870 on the current 1.31 nightly channel meaning you don't need #![feature(tool_lints)] to write #[allow(clippy::needless_pass_by_value)] either.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.