We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following program produces an off-by-one error:
#include <quadmath.h> #include <stdio.h> #include <stdint.h> int main() { union { __float128 f; uint32_t bv[2]; } data; union { __float128 f; uint32_t bv[2]; } result; char tmp[256]; data.bv[3] = 0x000064B5; data.bv[2] = 0x59A3D7F7; data.bv[1] = 0x56924E4F; data.bv[0] = 0xE681141C; quadmath_snprintf(tmp, sizeof(tmp), "%Qa", data.f); printf("Input: %s\n", tmp); result.f = sqrtq(data.f); quadmath_snprintf(tmp, sizeof(tmp), "%Qa", result.f); printf("Output: %s\n", tmp); printf("As BV: 0x"); for (int i=3; i>=0; --i) { printf("%08x", result.bv[i]); } printf("\n"); }
The result should be: 0x1FFF4121A5EFB86CD358C0F1BA4AE60B However we're getting: 0x1FFF4121A5EFB86CD358C0F1BA4AE60C
0x1FFF4121A5EFB86CD358C0F1BA4AE60B
0x1FFF4121A5EFB86CD358C0F1BA4AE60C
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following program produces an off-by-one error:
The result should be:
0x1FFF4121A5EFB86CD358C0F1BA4AE60B
However we're getting:
0x1FFF4121A5EFB86CD358C0F1BA4AE60C
The text was updated successfully, but these errors were encountered: