unsigned double를 unsigned int로 처리하는 처리 시스템이 합법적입니까?

C-C 언어의 unsigned double은 무엇입니까?(80733)|teratail
기대다
#include<stdio.h>

int main() {
    unsigned double  aa = 0.345;
    signed double bb = 0.4509;
    double cc = 0.472873;
    printf("%f\n", aa);
    printf("%f\n", bb);
    printf("%f\n", cc);
}
gcc 오류
prog.cc: In function 'int main()':
prog.cc:4:22: error: 'signed' or 'unsigned' invalid for 'aa'
     unsigned double  aa = 0.345;
                      ^~
prog.cc:5:19: error: 'signed' or 'unsigned' invalid for 'bb'
     signed double bb = 0.4509;
                   ^~
그러나 비주얼스튜디오 2015ver 14.02541.01 업데이트 3
warning C4076: 'unsigned': cannot be used with type 'double'
warning C4076: 'signed': cannot be used with type 'double'
warning C4477: 'printf' : format string '%f' requires an argument of type 'double', but variadic argument 1 has type 'unsigned int'
warning C4477: 'printf' : format string '%f' requires an argument of type 'double', but variadic argument 1 has type 'int'
되다우리 여기서 C4076의 설명을 읽으러 가자.
Compiler Warning (level 1) C4076 | Microsoft Docs
'typemod' : can not be used with type 'typename'
A type modifier, whether it is signed or unsigned , cannot be used with a noninteger type. typemod is ignored.
typemod is ignored 입니까?아니오, 저것은 ignore 가능합니까?의도에 어긋나는 코드를 만들 수 있습니까?
여기서 의문은 이것이 합법적인지 아닌지이다.

규격서를 읽다


조사 중입니다. 잠시만 기다리세요.우리도 정보 제공을 기다리고 있다...
C++11규격서 7.1.6(특히 7.1.6.2)이 문제가 될 수 있습니다.-TSUkasa#01[출고하려면](@a4lg)2017년 6월 21일

아직 규격서를 읽고 있지만 7.1.6으로 보면 특별한 제한이 없는 것 같다.
나는 이 일을 조사하기 위해 int long을 쓸 수 있다는 것을 이제야 알았다.unsigned double를 unsigned int로 처리하는 처리 시스템이 합법적입니까?by @yumetodo on @Qiita - 키토 돈지@ 작업(@SaitoAtsushi)https://t.co/zZXnCD5syB

좋은 웹페이지 즐겨찾기