3 Replies Latest reply on Jun 9, 2010 5:51 AM by genaganna

    float4 less than op

    bubu

      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) ???

       

        • float4 less than op
          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.

           

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

           

            • float4 less than op
              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

               

               

               

               

                • float4 less than op
                  genaganna

                   

                  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.