Message Boards Message Boards

A floor function equation M421 in CRUX

Posted 2 years ago

POSTED BY: Shenghui Yang
4 Replies

Hello, could you help me with my question? I have this function and I know that the range is a union of several intervals. Is there any way for Mathematica to give me the general formula of the range of this function?

(Abs[x] - Floor[x])/(Sqrt[2 - Floor[x]])

I found the ranges by defining an interval for x, following the example of what you wrote.

Reduce[FunctionRange[{(Abs[x] - Floor[x])/Sqrt[2 - Floor[x]], -50 <= 
    x < 0}, x, y]]

This is the plot:

Plot[(Abs[x] - Floor[x])/(Sqrt[2 - Floor[x]]), {x, -20, 3}]

enter image description here

Three things to consider:

  1. Only consider one continuous subdomain for x at a time. Floor function introduces non-linearity to the solution and in general no silver bullet to kill all problems.
  2. Beware of floor function for negative numbers. Test some numbers if you find it hard to memorize the behavior
  3. Plot on small scale and use customized grid lines to visualize the boundaries for jumpy ranges.

Only discuss the negative integer cases here:


Of course you also need to add the range for the positive part, which is easy to handle by choosing x in [0,1) and [1,2), or k = 0 and 1.

POSTED BY: Shenghui Yang

Thank you very much, sir

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract