Jennifer
02-26-2017, 10:40 PM
The Int() and fix() functions look to be equally good at isolating the digits to the left of the decimal place. Is that correct?
R/C
C
D
4
x
function
5
1
int(abs(x)) = '1', fix(abs(x)) = '1'
6
-1
int(abs(x)) = '1', fix(abs(x)) = '1'
7
123.456
int(abs(x)) = '123', fix(abs(x)) = '123'
8
-123.456
int(abs(x)) = '123', fix(abs(x)) = '123'
9
123.99999
int(abs(x)) = '123', fix(abs(x)) = '123'
10
-123.99999
int(abs(x)) = '123', fix(abs(x)) = '123'
11
123.999999999999000
int(abs(x)) = '123', fix(abs(x)) = '123'
12
-123.999999999999000
int(abs(x)) = '123', fix(abs(x)) = '123'
13
12.999999999999900
int(abs(x)) = '12', fix(abs(x)) = '12'
14
1.999999999999990
int(abs(x)) = '1', fix(abs(x)) = '1'
15
0.999999999999990
int(abs(x)) = '0', fix(abs(x)) = '0'
Is there a better way?
R/C
C
D
4
x
function
5
1
int(abs(x)) = '1', fix(abs(x)) = '1'
6
-1
int(abs(x)) = '1', fix(abs(x)) = '1'
7
123.456
int(abs(x)) = '123', fix(abs(x)) = '123'
8
-123.456
int(abs(x)) = '123', fix(abs(x)) = '123'
9
123.99999
int(abs(x)) = '123', fix(abs(x)) = '123'
10
-123.99999
int(abs(x)) = '123', fix(abs(x)) = '123'
11
123.999999999999000
int(abs(x)) = '123', fix(abs(x)) = '123'
12
-123.999999999999000
int(abs(x)) = '123', fix(abs(x)) = '123'
13
12.999999999999900
int(abs(x)) = '12', fix(abs(x)) = '12'
14
1.999999999999990
int(abs(x)) = '1', fix(abs(x)) = '1'
15
0.999999999999990
int(abs(x)) = '0', fix(abs(x)) = '0'
Is there a better way?