Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"truncation towards zero" could be "truncation" #6790

Open
Tevemadar opened this issue Feb 1, 2024 · 0 comments · May be fixed by #6835
Open

"truncation towards zero" could be "truncation" #6790

Tevemadar opened this issue Feb 1, 2024 · 0 comments · May be fixed by #6835

Comments

@Tevemadar
Copy link

Tevemadar commented Feb 1, 2024

Footnote at

This is often called truncation towards zero.

For integral operands, the \tcode{/} operator yields the algebraic quotient with
any fractional part discarded;
\begin{footnote}
This is often called truncation towards zero.
\end{footnote}

  1. The "towards zero" part appears to be redundant

Here are some variants of the description of truncation, one can encounter on the internet:

  • In simplest terms, truncation means to chop off the decimal portion of a number
  • truncation is limiting the number of digits right of the decimal point
  • To truncate a number, we miss off digits past a certain point in the number, filling-in zeros if necessary

They were picked exactly because they are different: one strictly happens to the entire fractional part, the second one happens somewhere in the fractional part, and the third one happens anywhere. Thus they allow production of different results, but what is still common in all of them is the act of replacing a part of the numeral notation (say, decimal notation) of a number with zero digits. The altered part is potentially infinitely long, but that does not even matter here: replacing a single non-zero digit with a zero brings a number closer to zero.

Besides being redundant, "towards zero" here subtly suggests that it is a choice, there are truncation operations that behave otherwise. This does not seem to be the case.

  1. "often" may not be true

If we accept that the number of hits in internet search engines do represent the frequency of usage of an expression to some extent, a couple hundred thousands hits for "truncation towards zero" does not feel "often" when compared to 100+ million hits discussing number truncation, presumably also bringing their result closer to zero.

This is only a guess, but it seems like the footnote may have talked about rounding at some point in the past, and then truncation got thrown in. Because rounding really offers choices, when to round "up" or "down", like the error-minimizing "half" roundings, round() functions usually implement the "half-up" flavour, but there are many more, then one can decide to round always towards positive infinity (ceil()), always towards negative infinity (floor()), and it is also possible to apply ceil() or floor() only to the magnitude of the number, where the latter one is indeed often called rounding towards zero, or truncation.
However, if "truncation towards zero" should be the correct expression, please consider adding where it comes from, because in 2024 it is not obvious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant