floating point range generator

Paul Rubin http
Mon Jul 28 14:23:03 EDT 2003


Carl Banks <imbosol at aerojockey.com> writes:
> In the interests of practicality beats purity, when you're
> interpolating (instead of stepping as in range) you should include the
> final endpoint.  In my experience, when when you divide a segment into
> intervals, you almost always want to include both endpoints.

I think you're right about this, but it goes against the Python notion
of a "range" function, so an frange that includes both endpoints
should be called something different, maybe "fstep" or something like
that.  For what I was doing, the frange that I posted did the job.

I see now that that the problem is subtle enough that IMO, a fully
worked out solution should be written and included in the Python
library or at least the Python cookbook.




More information about the Python-list mailing list