chickadee » srfi-252 » inexact-integer-generator

inexact-integer-generatorprocedure

Create an infinite generator that returns objects that fulfill the inexact? and integer? predicates. The generator should return the sequence

    0.0 -0.0 1.0 -1.0

first, then a uniformly random distribution of inexact integers. Elements of the above sequence may be omitted if they are not distinguished in the implementation.

    (define inexact-int-gen (inexact-integer-generator))

    (inexact-int-gen) ; => 0.0