Fix floattidf

This commit is contained in:
gingerBill
2021-04-14 20:45:05 +01:00
parent 05a181d719
commit e19958152a
2 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -127,9 +127,9 @@ floattidf :: proc(a: i128) -> f64 {
a <<= u128(DBL_MANT_DIG - sd); a <<= u128(DBL_MANT_DIG - sd);
} }
fb: [2]u32; fb: [2]u32;
fb[1] = (u32(s) & 0x80000000) | // sign fb[1] = (u32(s) & 0x80000000) | // sign
((e + 1023) << 20) | // exponent ((e + 1023) << 20) | // exponent
((u32(a) >> 32) & 0x000FFFFF); // mantissa-high u32((u64(a) >> 32) & 0x000FFFFF); // mantissa-high
fb[1] = u32(a); // mantissa-low fb[1] = u32(a); // mantissa-low
return transmute(f64)fb; return transmute(f64)fb;
} }
+4 -4
View File
@@ -127,9 +127,9 @@ floattidf :: proc(a: i128) -> f64 {
a <<= u128(DBL_MANT_DIG - sd); a <<= u128(DBL_MANT_DIG - sd);
} }
fb: [2]u32; fb: [2]u32;
fb[1] = (u32(s) & 0x80000000) | // sign fb[1] = (u32(s) & 0x80000000) | // sign
((e + 1023) << 20) | // exponent ((e + 1023) << 20) | // exponent
((u32(a) >> 32) & 0x000FFFFF); // mantissa-high u32((u64(a) >> 32) & 0x000FFFFF); // mantissa-high
fb[1] = u32(a); // mantissa-low fb[1] = u32(a); // mantissa-low
return transmute(f64)fb; return transmute(f64)fb;
} }