Hacker News new | ask | show | jobs
by pwdisswordfishc 846 days ago
> I have never seen a case where truncation was the right thing to do.

Splitting a quantity into units of differing orders of magnitude. For example, −144 minutes is −2 hours and −24 minutes, not −3 hours and 36 minutes. This is about the only case I know of, though.

2 comments

In generic numerics work there are two broad cases when you have a sea of sample points (eg: a 2D plane with samples taken all over) and you cast a mesh across the sea to divide the work into cells.

\1 samples have new coords relative to cell left edge and bottom edge.

    We're interested in sample distance from "classic" first quadrant axis.
\2 samples are weighted by distance from cell centre.

    We're pooling, combining channel layers, making representative central 'blobs', we're interested in cell sample positions relative to the centre point of the cell.
Your example is a good one, and falls in the case 2 grouping.

This, of course, generalises to 3D and higher dimensions.

Oh, that's a somewhat reasonable one. (Though I would expect that you actually want −(2 hours and 24 minutes) in many cases instead, thus needing to handle the negative case separately anyway.)