blob: 37ad01343f6855900fe9496e7e72d68806c4e02c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
//Ex19_21 Pg-965
clc
//Integer part
hex='F8E6'; //binary input
dec_I=hex2dec(hex) //decimal output
//Decimal part
a=3
b=9
dec=dec_I+a*16^(-1)+b*16^(-2) //decimal output
disp("The decimal equivalent of F8E6.39 is")
printf("\n %.4f",dec)
|