Is there a way to introduce logical tests into equations? For example, C has a very useful operator "?:" which returns values like so:(adsbygoogle = window.adsbygoogle || []).push({});

x = (x < 1) ? 1 : x;

which could be used in equations like this to multiply by 1 for any value less than 1.

[tex]Q(x) = \prod_{j=-5}^x ((j < 1) ? 1 : j) [/tex]

Just wondering...

Ken

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Logical tests in equations?

**Physics Forums | Science Articles, Homework Help, Discussion**