Remove duplicated bit shift

dev
Alberto Restifo 2020-05-03 13:43:23 +02:00
parent 332ca4af10
commit bb4d3e2b71
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ def Float32.new(i : UInt16)
half_man = (i & 0x03FF).to_u32
# Check for an infinity or NaN when all exponent bits set
if (i & 0x7C00) == 0x7C00
if half_exp == 0x7C00
# Check for signed infinity if mantissa is zero
if half_man == 0
return ((half_sign << 16) | 0x7F80_0000).unsafe_as(Float32)