Giter Club home page Giter Club logo

rand's People

Contributors

7i avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

rand's Issues

Complex128 generates after 16 iterations only (0+0i) regardless of seed value

Complex128 can't generate more than 16 values before only creating (0+0i).

Reproduce with this code:

package main

import (
    "fmt"

    "github.com/7i/rand"
)

func main() {
    r := rand.NewComplexRNG(2)
    for i := 0; i < 20; i++ {
        fmt.Println(r.Complex128())
    }
}

Output:

(1.6865675300359726-0.7458155155181885i)
(0.6459241434931755-0.5123334154486656i)
(-1.1976671814918518+0.30174003168940544i)
(1.9891699776053429+1.2461936622858047i)
(-1.5661767162382603-0.7391329631209373i)
(-0.8398294821381569+1.1099664196372032i)
(0.7193359322845936-0.07182033360004425i)
(1.4429706782102585-1.6247142776846886i)
(0.15417367964982986+0.37837256491184235i)
(1.3701438084244728-1.0620558746159077i)
(1.7493415288627148+1.051068291068077i)
(1.8130390085279942-1.6751261875033379i)
(1.8191914111375809-1.451352346688509i)
(-1.3210551738739014+1.2325180806219578i)
(1.8622635416686535-1.717281986027956i)
(-0.17155596241354942-1.9850400798022747i)
(0+0i)
(0+0i)
(0+0i)
(0+0i)

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.