summaryrefslogtreecommitdiff
path: root/include/math.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-17 21:40:10 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-17 21:40:10 -0400
commit65db6bf5ea1f27ec2cddd6423868baeff05cc719 (patch)
tree1fdaf1532ffbf408e4452ec1a930566d645916b8 /include/math.h
parentda0acc32efc85a91c4225157d22520743c6d8f8c (diff)
downloadmusl-65db6bf5ea1f27ec2cddd6423868baeff05cc719.tar.gz
c++ seems to want some casts in the float representation-access macros
Diffstat (limited to 'include/math.h')
-rw-r--r--include/math.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/math.h b/include/math.h
index 9c06c967..ec4afa78 100644
--- a/include/math.h
+++ b/include/math.h
@@ -41,8 +41,8 @@ int __fpclassify(double);
int __fpclassifyf(float);
int __fpclassifyl(long double);
-#define __FLOAT_BITS(f) (((union { float __f; __uint32_t __i; }){ (f) }).__i)
-#define __DOUBLE_BITS(f) (((union { double __f; __uint64_t __i; }){ (f) }).__i)
+#define __FLOAT_BITS(f) (((union { float __f; __uint32_t __i; }){ (float)(f) }).__i)
+#define __DOUBLE_BITS(f) (((union { double __f; __uint64_t __i; }){ (double)(f) }).__i)
#define fpclassify(x) ( \
sizeof(x) == sizeof(float) ? __fpclassifyf(x) : \