www.gusucode.com > fixedpoint 案例源码程序 matlab代码 > fixedpoint/CompareaDoubletoafiObjectFiveExample.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;
a < b 

%%
% The |lt| function casts |b| to the same word length as |a|, and returns
% |0| because the two inputs have the same real-world value. This behavior
% allows relational operations to work between |fi| objects and floating-point
% constants without introducing floating-point values in generated code.