A Function that could differentiate integers ($\in z^+$) from rest of positive real numbers

38 Views Asked by At

I need a function which could return a constant for all positive integers and another constant for rest of positive real numbers.

In piecewise function form, it is like this:-

$ f(n) = \begin{cases} constant1, & \text{if $n \in z^+$} \\ constant2, & \text{if $n \in R^+ \text{&} \notin z^+$ } \end{cases} $

This sine function returns $ \space {0} \space \forall{\space{x}} \in z^+ $

$\sin({{\pi}x})$, but it doesn't return another constant value for all positive non-integers.

Or say I need a sort function which can do implicit case handling, purely with operations and such things.