Skip to main content

logspace

lq.logspace(start, end, num: 50, include-end: true, base: 10.0)(source)

Generates an array of logarithmically-spaced numbers in the interval [base^start, base^end) or [base^start, base^end]. Useful for displaying functions on a log-scaled diagram.

#lq.logspace(-4, 4, num: 8, include-end: false)

This returns values from 10410^{-4} to 10410^4: (0.0001, 0.001, 0.01, 0.1, 1.0, 10.0, 100.0, 1000.0).

Parameters

start : int | float

Start of the exponent range.

end : int | float

End of the exponent range.

num : int    default: 50

Number of values to produce.

include-end : bool    default: true

Whether to include the end of the range. If true, samples are taken for the closed interval [start, end]. Otherwise, the last point is omitted.

base : int | float    default: 10.0

The base of the power.