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

fx = 0.350000 ;
Ex = 40 ;
fy = 0.500000 ;
Ey = 70 ;
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 < 0.1 then
    fz = fz*10
    Ez = Ez - 1
    mprintf('\n z = %f E%i (normalised) \n',fz,Ez)
end