www.gusucode.com > fixedpoint 案例源码程序 matlab代码 > fixedpoint/CompareaDoubletoafiObjectFourExample.m

    %% Compare a Double to a fi Object  
% When comparing a double to a |fi| object, the double is cast to the same
% word length and signedness of the |fi| object.   

%%  
a = fi(pi);
b = pi;
y = isequal(a, b) 

%%
% The |isequal| function casts |b| to the same word length as |a|, and returns
% |1|. This behavior allows relational operations to work between |fi| objects
% and floating-point constants without introducing floating-point values
% in generated code.