| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2019-09-09 
				
				
				
					帖子: 2
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 代码: 
	T.F = fimath('SumMode','SpecifyPrecision', 'SumWordLength', 10, 'SumFractionLength', 4);
a=fi(-32,1,10,4,T.F)
b=fi(-1.5,1,10,4,T.F)
c=fi(-25.9375,1,10,4,T.F)
d=fi(9,1,10,4,T.F)
K>> a+b+c+d
ans = 
   -23
          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 10
        FractionLength: 4
        RoundingMethod: Nearest
        OverflowAction: Saturate
           ProductMode: FullPrecision
               SumMode: SpecifyPrecision
         SumWordLength: 10
     SumFractionLength: 4
         CastBeforeSum: true
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |