IEEE Floating Point Rounding

IEEE Standard

The rule of thumb is to "round to nearest, tie to even", by which I mean it's the IEEE recommended rounding for floating point representation, though it's not strictly followed, case in point, tensorflow seems not to, wrapping around mantissa when converting fp32 to bf16. (check floating point - Convert FP32 to Bfloat16 in C++ - Stack Overflow)

  • Round to nearest, ties to even – rounds to the nearest value; if the number falls midway, it is rounded to the nearest value with an even least significant digit.

Key Update

there is a major misunderstanding on my part, taking "even LSB" as always setting the LSB to 0; the proper IEEE standard is

Rounding half to even

One may also round half to even, a tie-breaking rule without positive/negative bias and without bias toward/away from zero. By this convention, if the fractional part of x is 0.5, then y is the

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值