Decimal to Binary (ieee 754)
이전 댓글 표시
I want to create a code that converts decimal to ieee754. I do not want to use dec2bin so I do not know where to start. I want x to be my decimal number, eb to number of exponent bits and mb for my mantissa. The outputs are the convert value 'q' followed by s, e, m for sign, exponent, mantissa.
function [q, s, e, m,] = GetRepresentationIEEE754(x, eb, mb)
댓글 수: 5
Geoff Hayes
2016년 2월 13일
WhatIsMatlab - why are eb and mb variable inputs to your function? Aren't they fixed for IEEE 754 single and double precision formats?
Walter Roberson
2016년 2월 13일
num2hex() technically does not use dec2bin() :)
WhatIsMatlab-
2016년 2월 13일
편집: WhatIsMatlab-
2016년 2월 13일
Guillaume
2016년 2월 13일
Note that I wouldn't call my function conv as that name is already used by matlab for 1d convolution.
A better name would be GetRepresentationIEEE754.
WhatIsMatlab-
2016년 2월 13일
편집: WhatIsMatlab-
2016년 2월 13일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!