PowerRange
PowerRange[b]
generates the list {1,10,100,…,max}, where max is the largest power of 10 that does not exceed b.
PowerRange[a,b]
generates the list {a,10a,100a,…,max}, with successive elements increasing by factors of 10.
PowerRange[a,b,r]
uses factors of r instead of 10.
Details
- PowerRange effectively behaves like Range, but in "log-space".
- The arguments a and b to PowerRange need not be integers or powers of r, but must be either both positive or both negative.
- PowerRange starts from a and successively multiplies by r until the result is larger than b.
- If b/a is not a power of r, the endpoint b will not be included in the list generated by PowerRange.
Examples
open allclose allBasic Examples (2)
Scope (3)
Properties & Relations (3)
PowerRange produces lists whose elements have a constant ratio:
Range produces lists whose elements have a constant difference:
PowerRange can be implemented with NestWhileList:
PowerRange produces an explicit list of values with a constant ratio:
RSolveValue generates a formula for generating such a list:
Text
Wolfram Research (2014), PowerRange, Wolfram Language function, https://reference.wolfram.com/language/ref/PowerRange.html.
CMS
Wolfram Language. 2014. "PowerRange." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PowerRange.html.
APA
Wolfram Language. (2014). PowerRange. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PowerRange.html