# 浮点加法，无浮点！

9

1000 + 0.5 = 1000.5

``````01000100011110100000000000000000 + 00111111000000000000000000000000 = 01000100011110100010000000000000
``````

float.MaxValue + float.MaxValue =无穷大

``````01111111011111111111111111111111 + 01111111011111111111111111111111 = 01111111100000000000000000000000
``````

321.123 + -123.321 = 197.802

``````01000011101000001000111110111110 + 11000010111101101010010001011010= 01000011010001011100110101010000
``````

3

## Python，224个字符

``````V=lambda x:((-1)**int(x[0])<<int(x[1:9],2))*int('1'+x[9:],2)
B=lambda x,n:B(x/2,n-1)+'01'[x&1]if n else''
def A(x,y):
v=V(x)+V(y)
s=e=0
if v<0:s=1;v=-v
while v>=1<<24:v/=2;e+=1
if e>254:v=0
return'%d'%s+B(e,8)+B(v,23)
``````

3

# J（172个字符）

``````b=:(_1&^)@".@{.*[:#.1x,("."0)@(9&}.),#.@:("."0)@}.@(9&{.)\$0:
a=:b@[([:,(<&0)":"0@:,,@((8\$2)&#:)@(-&24)@\$@#:,}.@(24&{.)@#:@|)@(]`(**2x^278"_)@.((>&((2x^278)-2x^254))@|))@+b@]
``````

``````   '01000100011110100000000000000000' a '00111111000000000000000000000000'
01000100011110100010000000000000
'01111111011111111111111111111111' a '01111111011111111111111111111111'
01111111100000000000000000000000
'01000011101000001000111110111110' a '11000010111101101010010001011010'
01000011010001011100110101001111
``````