Jiew Meng
Jiew Meng

Reputation: 88197

IEEE 754 Floating Point Round to Nearest

In my notes I have something like

If (Guard & !Round & !Sticky)
    If (LSB == 1) 
        LSB += 1
Else If (Guard) 
    LSB += 1
End If

So I could just simplify it to

If Guard Then 
    LSB += 1

Upvotes: 0

Views: 780

Answers (1)

Michael Borgwardt
Michael Borgwardt

Reputation: 346300

No. What about this case?

Guard==true
Sticky==false
Round==false
LSB==0

The original code would not execute LSB += 1 in that case, yours would.

Upvotes: 1

Related Questions