⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flplot.m

📁 SFLOP simulates a floating point operation x op y where op = +, -, *, /
💻 M
字号:
       %%  PURPOSE:%  FLPLOT  plots all positive floating point numbers for %  a given base, exponent range and mantissa length%%%  Matthias Heinkenschloss%  Department of Computational and Applied Mathematics%  Rice University%  Feb 12, 2002%%disp('  Plot of all positive floating point numbers                 ')disp('             0       -1      -2            -(t-1)   e         ')disp('  x = ( d * b + d * b + d * b +..... d   * b  )  * b  ,       ')disp('         0       1       2            (t-1)                   ')disp('                                                              ')disp('  where   b =2  is the base and  e  in [ e_min, e_max ] is the exponent. ')b = 2;t     = input(' Mantissa length t = ');e_min = input(' lower boundary of exponent range e_min = ');e_max = input(' upper boundary of exponent range e_max = ');x = [0];k = 1;for e = e_min:e_max    k = k+1;    x = [x, b^e];    while( x(k) < b^(e+1)*(1-b^(-t)) )        k = k+1;        x = [x, x(k-1) + b^(e-(t-1))];    endend    disp(x')        plot(x,zeros(size(x)),'r+' )title(['positive floating point numbers (\beta = 2, t=',int2str(t),...       ' e_{min} =', int2str(e_min),' e_{max} =', int2str(e_max),')'])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -