瀏覽代碼

float is suficient and a _little_ faster in coolsize()

master
Arun Prakash Jana 6 年之前
父節點
當前提交
928699d4a4
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A75979F35C080412
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. +2
    -2
      nnn.c

+ 2
- 2
nnn.c 查看文件

@@ -1441,7 +1441,7 @@ coolsize(off_t size)
static char size_buf[12]; /* Buffer to hold human readable size */
static int i;

static long double rem;
static off_t rem;
static const double div_2_pow_10 = 1.0 / 1024.0;

i = 0;
@@ -1453,7 +1453,7 @@ coolsize(off_t size)
++i;
}

snprintf(size_buf, 12, "%.*Lf%c", i, size + rem * div_2_pow_10, U[i]);
snprintf(size_buf, 12, "%.*f%c", i, size + (float)rem * div_2_pow_10, U[i]);
return size_buf;
}



Loading…
取消
儲存