Skip to content

Commit 3ec7d8d

Browse files
committed
Fix signbit(double) implementation on MSVC.
Likely related to pytorch/pytorch#52299.
1 parent df8afb8 commit 3ec7d8d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

thrust/detail/complex/c99math.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ __host__ __device__ inline int isnan(double x){
8484
}
8585

8686
__host__ __device__ inline int signbit(float x){
87-
return (*((uint32_t *)&x)) & 0x80000000;
87+
return ((*((uint32_t *)&x)) & 0x80000000) != 0 ? 1 : 0;
8888
}
8989

9090
__host__ __device__ inline int signbit(double x){
91-
return (*((uint32_t *)&x)) & 0x80000000;
91+
return ((*((uint64_t *)&x)) & 0x8000000000000000) != 0ull ? 1 : 0;
9292
}
9393

9494
__host__ __device__ inline int isfinite(float x){

0 commit comments

Comments
 (0)