extend units from quecto to Quetta
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 22 Nov 2022 22:38:11 +0000 (23:38 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 22 Nov 2022 23:06:47 +0000 (00:06 +0100)
Recently accepted in the 27th BIPM meeting.

barcat
t/t1405-megametric.in [new file with mode: 0644]
t/t1405-megametric_-Hes.out [new file with mode: 0644]

diff --git a/barcat b/barcat
index c3c0dfd86faf8d56c773ca67a47a2062ab48dcb3..6fd5b5aacff5684e4027d60a75471094c757e178 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -115,7 +115,7 @@ $opt{width} ||= $ENV{COLUMNS} || qx(tput cols) || 80 unless $opt{spark};
 $opt{color} //= $ENV{NO_COLOR} ? 0 : -t *STDOUT;  # enable on tty
 $opt{'graph-format'} //= '-';
 $opt{trim}   *= $opt{width} / 100 if $opt{trimpct};
-$opt{units}   = [split //, ' kMGTPEZYyzafpn'.($opt{ascii} ? 'u' : 'μ').'m']
+$opt{units}   = [split //, ' kMGTPEZYRQqryzafpn'.($opt{ascii} ? 'u' : 'μ').'m']
        if $opt{'human-readable'};
 $opt{anchor} //= qr/\A/;
 $opt{'value-length'} = 4 if $opt{units};
diff --git a/t/t1405-megametric.in b/t/t1405-megametric.in
new file mode 100644 (file)
index 0000000..3b79929
--- /dev/null
@@ -0,0 +1,65 @@
+3e-32
+3e-31
+3e-30
+3e-29
+3e-28
+3e-27
+3e-26
+3e-25
+3e-24
+3e-23
+3e-22
+3e-21
+3e-20
+3e-19
+3e-18
+3e-17
+3e-16
+3e-15
+3e-14
+3e-13
+3e-12
+3e-11
+3e-10
+3e-9
+3e-8
+3e-7
+3e-6
+3e-5
+3e-4
+3e-3
+3e-2
+3e-1
+3e0
+3e1
+3e2
+3e3
+3e4
+3e5
+3e6
+3e7
+3e8
+3e9
+3e10
+3e11
+3e12
+3e13
+3e14
+3e15
+3e16
+3e17
+3e18
+3e19
+3e20
+3e21
+3e22
+3e23
+3e24
+3e25
+3e26
+3e27
+3e28
+3e29
+3e30
+3e31
+3e32
diff --git a/t/t1405-megametric_-Hes.out b/t/t1405-megametric_-Hes.out
new file mode 100644 (file)
index 0000000..937b051
--- /dev/null
@@ -0,0 +1,66 @@
+ 30e-34 
+300e-33 
+3.0e-32 
+ 30e-31 
+300e-30 
+3.0r 
+ 30r 
+300r 
+3.0y 
+ 30y 
+300y 
+3.0z 
+ 30z 
+300z 
+3.0a 
+ 30a 
+300a 
+3.0f 
+ 30f 
+300f 
+3.0p 
+ 30p 
+300p 
+3.0n 
+ 30n 
+300n 
+3.0μ 
+ 30μ 
+300μ 
+3.0m 
+ 30m 
+300m 
+3.0  -
+ 30  --
+300  ---
+3.0k ----
+ 30k -----
+300k ------
+3.0M -------
+ 30M --------
+300M ---------
+3.0G ----------
+ 30G -----------
+300G ------------
+3.0T ------------>
+ 30T ------------>--
+300T ------------>---
+3.0P ------------>----
+ 30P ------------>-----
+300P ------------>------
+3.0E ------------>-------
+ 30E ------------>--------
+300E ------------>---------
+3.0Z ------------>----------
+ 30Z ------------>-----------
+300Z ------------>------------
+3.0Y ------------>-------------
+ 30Y ------------>--------------
+300Y ------------>----------------
+3.0R ------------>-----------------
+ 30R ------------>------------------
+300R ------------>-------------------
+3.0e30 ------------>-------------------=
+ 30e31 ------------>-------------------=-
+300e32 ------------>-------------------=--
+333e32 total in 65 values ( 30e-34 min, 5.1e30 avg, 300e32 max)