summaryrefslogtreecommitdiff
path: root/243/CH3/EX3.20/3_20.sce
blob: 6496ad36d1ecd39e1eb5884eb902d7441fe4bd1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//Example No. 3_20
//Floating Point Arithmetic
//Pg No. 56
clear ;close ;clc ;

fx = 0.875000 ;
Ex = -18 ;
fy = 0.200000 ;
Ey = 95 ;
fz = fx/fy
Ez = Ex - Ey 
mprintf('\n fz = %f \n Ez = %i \n z = %f E%i \n',fz,Ez,fz,Ez)

if fz > 1 then
    fz = fz/10
    Ez = Ez + 1
    mprintf('\n z = %f E%i (normalised) \n',fz,Ez)
end