# implicit cast vector to float? [solved]

## Recommended Posts

Posted (edited)

Hey!

I am trying to delete geometry by comparing two vectors. For some reason  (also it only seems to compare the first dimension in the vector rather then each value) I keep getting a implicit cast (vector to float) error even though I am comparing two vectors. How does that make any sense?  Do I have to compare the individual values rather a the vector as a whole? Thanks in advance

edit: Also v@test I set to {2,2,2}, but some areas have {2,2,0.5}.  If thres is {2,2,1} shouldn't areas with {2,2,0.5} get deleted? because {2,2,0.5} < {2,2,1}?

Evan

Edited by ejr32123

##### Share on other sites

AFAIK there's no vector comparison in vex. What you are doing is just comparing the first element of the vector. Depending on your needs you can use length to get the magnitude of the vector and compare them instead. Either that or you can write your own function to compare the vectors in a way that suits your needs.

• 1

##### Share on other sites
46 minutes ago, vtrvtr said:

AFAIK there's no vector comparison in vex. What you are doing is just comparing the first element of the vector. Depending on your needs you can use length to get the magnitude of the vector and compare them instead. Either that or you can write your own function to compare the vectors in a way that suits your needs.

Thanks so much! That would make sense.

##### Share on other sites
Posted (edited)

I just saw this in the manual:

The comparison operators (==, !=, <, <=, >, >=) are defined when the left hand of the operator is the same type as the right hand side, for string, float and integer types only. The operations result in integer types.

@vtrvtr you are 100% right

Edited by ejr32123

## Create an account

Register a new account