# Using raster calculator to show multiples of particular value?

How do I use raster calculator so that the new raster only shows multiples of 128?

I'm not sure what the expression should be.

• It might be useful to understand the purpose. What is the input? – jbchurchill May 12 '16 at 12:56

Something like this would do the trick:

``````Con(Con(**input_raster**,Mod(**input_raster**,128))==0,**input_raster**)
``````

Let's break this apart:

The inner Con statement takes your input raster as a conditional raster and returns its modulus against test value (in this case 128). The Mod function returns zero where the number is divisible by your test value, If not it returns the original value. Be careful with this.

The outer Con statement takes the result from the inner Con and checks if it is equal to zero, then returns the original values (multiples of 128) if true.

Example:

Inner Con Results - Note how values not divisible by 128 are treated. Outer Con Results • (+1) The two uses of `con` are redundant. In fact, an alternative might be better. `SetNull(Mod(**input**, 128)!=0, **input**)` may be closer to what was desired. – whuber May 12 '16 at 16:39