LoginSignup
2
2

More than 5 years have passed since last update.

bash > 対数スケールで等間隔に取りたい

Last updated at Posted at 2015-01-03

bashのスクリプト内で対数スケールで等間隔を取りたい時があります。

自分が知っている方法は

for rad in 1E-4 1E-3 1E-2 1E-1 1E0 1E2; do
  echo $rad
done

のようにforで回す方法です。

ただ、この場合、inの後の数値リストは自分で用意しないといけないです。

別プログラムで等間隔の数値を出力したものをはりつけるというのでもいいのですが、seq 1 10のようなコマンドを組み合わせてbashスクリプトのみで、0.0001から10の範囲で等間隔を取れないか思案中です。

良い案があれば教えていただきたいと思います。

2
2
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2