cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

bubu
Adept II

float4 less than op

What's the result of

 

float4 v = (float4)(-2.0f,1.0f,-3.0f,4.0);

XXXX res = (v<0.0f)

 

pls?

 

an int4 like (1,0,1,0) ???

 

0 Likes
3 Replies
eduardoschardong
Journeyman III

int4 like (-1, 0, -1, 0)

It's defined in the spec section 6.3.d, for scalar type it's int, 1 for true and 0 for false like C.

 

Yes, it differs for vector and scalar types, I hate it too.

 

0 Likes

Originally posted by: eduardoschardong int4 like (-1, 0, -1, 0)

 

It's defined in the spec section 6.3.d, for scalar type it's int, 1 for true and 0 for false like C.



Thanks, I didn't see that.

What I hate are statements in the official documentation without examples

 

 

 

 

0 Likes

Originally posted by: bubu
Originally posted by: eduardoschardong int4 like (-1, 0, -1, 0)

 

 

 

It's defined in the spec section 6.3.d, for scalar type it's int, 1 for true and 0 for false like C.



 

Thanks, I didn't see that.

 

What I hate are statements in the official documentation without examples

 

I donot think we should expect these examples from spec doc. If spec start adding examples, it becomes 3000 pages instead of 300 pages.

0 Likes