# How does the snap math node work?

Pretty much the title, I'm pretty confused and the blender documentation doesn't help much : "Round the input value to down to the nearest integer multiple of Increment"

It does what it says on the tin.. :) .. it winds up being a staircase function:

.. with the rise and tread both being the 'Increment'. Here, shown with increments of 2, 1, and 2/3.

For any input X, the output will be X, rounded down to the nearest whole-number multiple of 'Increment'.

Thanks again to @Rich Sedman for this way of visualising functions..

Because of the great geometry nodes you can also watch easily the snap values with this node setup:

Just change the B-values and/or the x/y offset values and watch what happens.

As @batFINGER points out, in Python, it could be: increment * (x // increment)

• So say for example for an increment of 1, X = 1. Will Snap(X) be 0 or 1? Aug 25, 2021 at 13:40
• Look at the picture : offset is 1 - x is 1 - snapx is 0 so the answer is: it is 0 Aug 25, 2021 at 13:50
• It should be 1, bearing in mind, in floating-point world, you can't necessarily rely on there being any such thing as 1. Aug 25, 2021 at 13:53
• Alright, im gonna have to digest this for a bit. Thank you for the answers. Aug 25, 2021 at 14:10
• Robin, Scriptwise Is this n * (x // n) where n is the increment? Aug 25, 2021 at 14:19