mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 21:38:33 +00:00
compiler-rt: Fix typo in implementation of fp truncation ops
The problem went unnoticed for years, yay.
This commit is contained in:
parent
f9481402f0
commit
8e0b2f0e52
@ -122,7 +122,7 @@ fn truncXfYf2(comptime dst_t: type, comptime src_t: type, a: src_t) dst_t {
|
||||
if (shift > srcSigBits) {
|
||||
absResult = 0;
|
||||
} else {
|
||||
const sticky: src_rep_t = significand << @intCast(SrcShift, srcBits - shift);
|
||||
const sticky: src_rep_t = @boolToInt(significand << @intCast(SrcShift, srcBits - shift) != 0);
|
||||
const denormalizedSignificand: src_rep_t = significand >> @intCast(SrcShift, shift) | sticky;
|
||||
absResult = @intCast(dst_rep_t, denormalizedSignificand >> (srcSigBits - dstSigBits));
|
||||
const roundBits: src_rep_t = denormalizedSignificand & roundMask;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user