91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-14
  • 語言: Matlab
  • 標簽: 未分類??

資源簡介

matlab開發-IEEE754二進制表示。將double轉換為其基礎的64位表示形式,包括符號、指數和尾數。

資源截圖

代碼片段和文件信息

function?[sef]?=?ieee754(xfmt)
%IEEE754?Decompose?a?double?precision?floating?point?number.
%?[SEF]?=?IEEE754(X)?returns?the?sign?bit?exponent?and?mantissa?of?an
%?IEEE?754?floating?point?value?X?expressed?as?binary?digit?strings?of
%?length?1?11?and?52?respectively.?
%
%?S?=?IEEE754(X)?returns?one?string?of?length?64.
%
%?[SEF]?=?IEEE754(X‘dec‘)?returns?S?E?and?F?as?floating-point?numbers.
%
%?X?is?equal?to?(in?exact?arithmetic?and?decimal?notation)
%
%??????(-1)^S?*?(1?+?F/(2^52))?*??2^(E-1023)
%
%?except?for?special?values?0?Inf?NaN?and?denormalized?numbers?(between
%?0?and?REALMIN).?
%
%?See?also?FORMAT?REALMAX?REALMIN?BIN2DEC.

%?Copyright?2009?by?Toby?Driscoll?(driscoll@udel.edu).?
%?Thanks?to?Andreas?Luettgens?for?the?suggestion?of?NUM2HEX.

if?~isreal(x)?||?numel(x)?>?1?||?~isa(x‘double‘)
??error(‘Real?scalar?double?input?required.‘)
end
hex?=?num2hex(x);????????%?string?of?16?hex?digits?for?x
dec?=?hex2dec(hex‘);?????%?decimal?for?each?digit?(1?per?row)
bin?=?dec2bin(dec4);????%?4?binary?digits?per?row
bitstr?=?reshape(bin‘[1?64]);??%?string?of?64?bits?in?order

%?Return?options
if?nargout<2
??s?=?bitstr;??????
else
??s?=?bitstr(1);
??e?=?bitstr(2:12);
??f?=?bitstr(13:64);
??if?nargin?>?1?&&?isequal(lower(fmt)‘dec‘)
????s?=?bin2dec(s);??e?=?bin2dec(e);??f?=?bin2dec(f);
??end
end

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1337??2013-10-30?20:41??ieee754.m
?????文件????????1314??2014-02-12?14:37??license.txt

評論

共有 條評論