0 like 0 dislike
0 like 0 dislike
How to "zoom in" on the one number before the decimal?

3 Answers

0 like 0 dislike
0 like 0 dislike
The "floor" of x gives you the integer part obtained by rounding down, so e.g. floor(12345.67) = 12345. (I'm purposely sweeping the issue of recurring 9s in the decimal under the rug here.)

Assuming N is a nonnegative integer, the remainder of N when divided by 10 (often written N % 10) is the last digit, so e.g. 12345 % 10 = 5.

So the last digit before the decimal point of a nonnegative real number x is floor(x) % 10.

If x is negative then you can just flip the sign by taking the absolute value |x| and then apply the above, so the formula that works for all real numbers x is floor(|x|) % 10.
0 like 0 dislike
0 like 0 dislike
Modulo 10 should do it.
0 like 0 dislike
0 like 0 dislike
Is this a programming problem? In that case the modulo operation will probably help you though to the best of my knowledge most programming languages implement modulo in integer form i.e. you will lose everything after the decimal. If you absolutely need everything after the decimal and the width after the decimal point is fixed then you form a dummy variable by multiplying your original variable with 10\^(precision) and then doing a modulo like: (dummy variable) % 10\^ (precision + 1)

Related questions

0 like 0 dislike
0 like 0 dislike
0 answers
MorganHoover_ asked Jun 21
"Previous comparison of change in CAPS score between sertraline and placebo showed effect sizes of 0.31 and 0.37 (ref. 16). Similarly, comparison of change in CAPS score ...
MorganHoover_ asked Jun 21
0 like 0 dislike
0 like 0 dislike
6 answers
sigaouli asked Jun 21
Quitting job possibly to work on mental health issues but gap in employment could affect job prospects in the future
sigaouli asked Jun 21
0 like 0 dislike
0 like 0 dislike
2 answers
KUKA_Americas asked Jun 21
[General textbook related question] Writing references to prerequisite material within harder problems in the textbook
KUKA_Americas asked Jun 21
0 like 0 dislike
0 like 0 dislike
1 answer
TEDxJAX asked Jun 21
I’m trying to find a pdf version of Haese’s Mathematics for Australia 11 Mathematical Methods. I’m in high school and would love electronic copies of this and the y...
TEDxJAX asked Jun 21
by TEDxJAX
0 like 0 dislike
0 like 0 dislike
2 answers
Pedro32santos asked Jun 21
I am trying to prove something and I am on the right track (I think). But I need help on how to accurately describe what I want to do mathematically. Further explanation ...
Pedro32santos asked Jun 21

24.8k questions

103k answers

0 comments

33.7k users

OhhAskMe is a math solving hub where high school and university students ask and answer loads of math questions, discuss the latest in math, and share their knowledge. It’s 100% free!