0

I'm having an issue at work where several of us are seemingly arguing over a naming convention in piece of software we're writing.

Basically, suppose we have 3 variables $x, y, z$. $z$ is usually some nice even number like 1000. $x$ and $y$ are integers.

We want to compute a rounded version of $x + y$ (call it $a$) to the nearest multiple of $z$ by adding an offset to $y$.

Here's an example. $x = 1000, y = 200, z = 1000$.

$x + y = 1200$ and the nearest multiple is 1000. So the offset we need to add to $y$ is $-200$. The petty issue we're arguing over is whether we can call this operation of adding the offset to $y$ rounding? Is there an official mathematical terminology for this?

24n8
  • 1,455
  • You can probably describe this with an appropriate scaling of the nearest integer function. https://mathworld.wolfram.com/NearestIntegerFunction.html or the distance to the nearest integer https://proofwiki.org/wiki/Definition:Distance_to_Nearest_Integer_Function – Ethan Bolker Mar 21 '24 at 01:47
  • In one of its ancient calculator manuals HP calls it "normalize the data". This is an advice for big values with small differences in context of linear regression. See manual of HP10C, note on p. 40. – m-stgt Mar 21 '24 at 02:38

0 Answers0