I'm using an ultrasonic sensor output to produce a long distance value. Is it possible to turn the long directly into an int to use for pin activation without using a float?
Yes.
(Why is it even a float in the first place?)
Assuming you're programming on an 8-bit AVR, a long is 32 bits and an int is 16 bits. As long as the value stored in the long can fit in 16 bits, there is no "rounding". If it can't then the conversion is meaningless.
shwiiin:
I'm using an ultrasonic sensor output to produce a long distance value. Is it possible to turn the long directly into an int to use for pin activation without using a float?
By "an int to use for pin activation" do you mean a LOW or HIGH value? If so, what distances do you want LOW and what distances do you want HIGH?
I believe that int yourInt = round(yourFloat/65539)
will work to compress this down to an int.