IDE avoiding math operation I have no idea why this has been happening:

byte potenciometro = 0;int redpin=9;  

void setup() {
Serial.begin(9600);
}

void loop() {
int valor=analogRead(potenciometro);  delay(50);
Serial.println();
Serial.print(valor, DEC);

analogWrite(redpin,valor);   }


This code above has been working just fine. However, i understand the LEDs will work properly with intensities that range from 1 to 255, so i replaced this line

Serial.print(valor, DEC);


for this 
    Serial.print((valor/700)*255, DEC);

and all that the IDE has been returning since then is 0 as console output.

i tried also just 

Serial.print(valor/700, DEC);


and i get nothing but 0s

anyone?

my arduino is the UNO version.
In the C family of programming languages, the division operator (/),
when used with integer arguments, provides an integer division. You
get the integer quotient, and you can use % to get the remainder.

If you want a floating point division, then at least one of the
arguments should be a floating point number. E.g.:



Serial.print(valor / 700.0 * 255);


(the DEC argument is redundant). The final result is then truncated to
an integer before being passed to Serial.print().

A better option, which is outlined in dhimaspw's answer, is to do the
multiplication before the division. This way you avoid costly floating
point operations. If you do that, however, you should be careful about
overflows: valor*255 can be as big as 1023&nbsp;×&nbsp;255
=&nbsp;260865, which is larger than the maximum value an int can store
(215−1 =&nbsp;32767). You should then write

Serial.print(valor * 255L / 700);


where the L suffix forces the operation to be carried using long
integers.

The simplest solution, however, is to use the Arduino function map(),
which does essentially the same as above:

Serial.print(map(valor, 0, 700, 0, 255));