Changing signed integer 16 bit format to binary format.

조회 수: 22 (최근 30일)
SeungHyun Cha
SeungHyun Cha 2020년 4월 14일
댓글: SeungHyun Cha 2020년 4월 14일
How can I express the BIGGEST NEGATIVE number and SMALLEST POSITEVE number of a signed integer 16 bit format?
I know the range of singed integer 16 bit format is from -32768 to 32767, but...
Q1.I am not sure which value is the biggest negative and smallest positive.
Q2. Also, if there is negative integer value, how can I convert negative to binary?

채택된 답변

Walter Roberson
Walter Roberson 2020년 4월 14일
dec2bin(typecast(intmin('int16'),'uint16'))
dec2bin(typecast(intmax('int16'),'uint16'))
  댓글 수: 6
Walter Roberson
Walter Roberson 2020년 4월 14일
dec2bin(typecast(int16(-1),'uint16'))
SeungHyun Cha
SeungHyun Cha 2020년 4월 14일
Thank you two experts...!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by