trange(1): -l option: treat limits as absolute values, not exponents - numtools - perform numerical operations on vectors and matrices in unix pipes
HTML git clone git://src.adamsgaard.dk/numtools
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 582f4a33313af4f079c993be90659bf26923f67c
DIR parent db72bc66161a10f23696e131d5748a27ddfafeaf
HTML Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 25 May 2022 11:18:27 +0200
range(1): -l option: treat limits as absolute values, not exponents
Diffstat:
M range.1 | 6 ++++--
M range.c | 4 ++++
2 files changed, 8 insertions(+), 2 deletions(-)
---
DIR diff --git a/range.1 b/range.1
t@@ -59,8 +59,10 @@ as the last value, making it a half-open interval
or an entirely open interval when combined with
.Op Ar b .
.It Fl l
-Produce output with even intervals in logarithmic space between 10^min_val
-and 10^max_val.
+Produce output with even intervals in logarithmic space between
+.Ar min_val
+and
+.Ar max_val .
.It Fl n
Do not print a newline after the final value.
.It Fl N Ar num
DIR diff --git a/range.c b/range.c
t@@ -74,6 +74,10 @@ main(int argc, char *argv[])
if (!sscanf(argv[0], "%lf", &maxv))
errx(1, "bad maxv value: %s", argv[0]);
+ if (logrange) {
+ minv = log10(minv);
+ maxv = log10(maxv);
+ }
dx = (maxv - minv) / (n - 1 + openend + openstart);
if (reportdx) {
printf("%.*g", prec, dx);