# Simplify Mod to subtraction when possible

FullSimplify[Mod[t,10], t>101 && t<109]

It's a long shot, but can I get Mathematica to return t-100 or something similar for the above?

Currently it returns just Mod[t,10] itself, which is accurate, but I want even more simplification based on my conditions.

Assuming[101 < t < 109, FullSimplify[PiecewiseExpand[Mod[t, 10]]]]


rhermans gives a simpler formulation:

PiecewiseExpand[Mod[t, 10], 101 < t < 109]

• That works, even without the FullSimplify, but I'm not sure why, since PiecewiseExpand[Mod[t, 10]] just returns Mod[t, 10]. I'm guessing Assuming does some sort of Hold on its second argument, hmmm. Will investigate further on my own :)
– user1722
Oct 9, 2015 at 15:09
• That too PiecewiseExpand[Mod[t, 10], 101 < t < 109] Oct 9, 2015 at 15:10
• Who knew that Mod was secretly a "nested piecewise function"!
– user1722
Oct 9, 2015 at 15:11
• Documentation says: "PiecewiseExpand converts such functions as If, Which, Abs, Max, UnitStep, and Floor to Piecewise. " Oct 9, 2015 at 15:12
• I'm confused about the different ways the assumptions are used in each case, see this question Oct 9, 2015 at 15:34