소스 검색

float is suficient and a _little_ faster in coolsize()

master
Arun Prakash Jana 7 년 전
부모
커밋
928699d4a4
No known key found for this signature in database 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;
}



불러오는 중...
취소
저장