using ColorBitstring, SetRounding
Copyright By PowCoder代写 加微信 powcoder
We can set rounding
printlnbits(Float16(1/3, RoundDown))
printlnbits(Float16(1/3, RoundNearest))
printbits(Float16(1/3, RoundUp))
0011010101010101
0011010101010101
0011010101010110
x = Float16(1)
y = Float16(2^(-12))
Float16(1.0)
nonassociativity:
Float16(1.0)
x + (y + y)
Float16(1.0)
Float16(1 + 2^(-11))
1.00048828125
printbits(x + 4y)
0011110000000001
(x + 4y) – 4y
Float16(1.0)
0.00048828125
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com