mercredi 30 novembre 2022

A simple way to generate a sequence of doubles within a given range? DoubleStream

I'm trying to generate an infinite sequence of doubles between 0.5, and 0.8 utilizing the DoubleStream, but I'm not sure how to do the range part?

I currently have something like this ->

public static final DoubleStream generate = DoubleStream.generate(Math::random);



Aucun commentaire:

Enregistrer un commentaire