이 웹사이트는 자바스크립트 활성화가 필요합니다.
홈
탐색
도움말
가입하기
로그인
SisMaker
/
jiffy
보기
1
좋아요
0
포크
0
코드
이슈
0
풀 리퀘스트
0
Projects
0
릴리즈
62
위키
활동
소스 검색
issue
#31
: encode floating point numbers with less precision if possible. fails a few etap tests, though I believe it's due to the specific values expected
pull/32/head
Ryan Flynn
12 년 전
부모
3b6a1327d4
커밋
b045a37391
1개의 변경된 파일
과
7개의 추가작업
그리고
1개의 파일을 삭제
분할 보기
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-1
c_src/encoder.c
+ 7
- 1
c_src/encoder.c
파일 보기
@ -4,6 +4,7 @@
#
include
<assert.h>
#
include
<stdio.h>
#
include
<string.h>
#
include
<float.h>
#
include
"erl_nif.h"
#
include
"jiffy.h"
@ -401,7 +402,12 @@ enc_double(Encoder* e, double val)
start
=
&
(
e
-
>
p
[
e
-
>
i
]
)
;
sprintf
(
start
,
"
%0.20g
"
,
val
)
;
/
/
try
to
encode
doubles
using
the
fewest
digits
possible
.
.
.
if
(
snprintf
(
start
,
32
,
"
%.*g
"
,
DBL_DIG
,
val
)
>
FLT_DIG
)
{
/
/
.
.
.
fall
back
to
full
expansion
to
be
safe
snprintf
(
start
,
32
,
"
%.*g
"
,
LDBL_DIG
,
val
)
;
}
len
=
strlen
(
start
)
;
/
/
Check
if
we
have
a
decimal
point
쓰기
미리보기
불러오는 중...
취소
저장