How to formally define decimal truncation? f_n(r)=10^{-n}\operatorname{sign}(r)\left\lfloor 10^n|r|\right\rfloor

Bailee Ortiz

Bailee Ortiz

Answered question

2022-04-23

How to formally define decimal truncation?
fn(r)=10-nsign(r)10n|r|

Answer & Explanation

Landyn Whitney

Landyn Whitney

Beginner2022-04-24Added 19 answers

Step 1
fn(r)=10-nsign(r)10n|r|
Where x is the greatest integer x
This can be written as:
1) fn(r)=10nf0(10nr)
The use of absolute values and sign reflects that it is somewhat arbitrary to “truncate” towards zero.
For example, if r is positive and n is a positive integer, then f0(r+n)=f0(r)+n,, but this doesn’t generalize to all real r and integers n.
You could substitute
g0(r)=r+12r
and define gn using the equivalent of (1) to define rounding to n digits.
Rounding is more natural because g0(r+n)=g0(r)+n for all real r and integer n. The only time you will get f0(r)f0(r) is when r is exactly a half-integer.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?