Commits

Lionel Flandrin  committed 3dc756f

Fix formatting bug in size printer

  • Participants
  • Parent commits 90a94c9

Comments (0)

Files changed (3)

   const char        *link     = " - ";
 
   if (v == 0) {
-    o << '0' << this->unit;
+    o << '0';
+    if (*this->unit)
+      o << '*' << this->unit;
     return;
   }
 

File tests/expected-output.txt

 2'sb11
 4'b1010 +0.1
 5'sb10110 -0.1
-0B
+0*B
 1*kB
 1*MB
 1*k - 1
 -3*GB - 253*MB - 262*kB - 913*B
 -3*G - 486*M - 784*k - 401
+21*GB - 866*MB - 680*kB - 441*B +0.0367928634484249785161
+-23*G - 457*M - 341*k - 881 -0.0367928634484249785161
+0*B
+0*B +0.01
+0 +0.00000050603
+4*kB - 904*B +0.00000054
 2101587420200.001001
 42
 42

File tests/tests.txt

 -3**20:s
 -3**20:si
 
+3.3**20:s
+-3.3**20:si
+
+0:s
+0.010:s
+0.00000050603:si
+5000.00000054:s
+
 # Variables
 k + M + G + T + m + u + n + p + kB + MB + GB + TB
 var = 42