You are not logged in.
Pages: 1
Given f(x) = int(x/2), find a to c.
a. f(1.2)
b. f(1.6)
c. f(-1.8)
Offline
Start with x 1.2, half it, take the integer part of the result.
When x is negative you'll need to check whether to round up or down to get the integer part.
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Start with x 1.2, half it, take the integer part of the result.
When x is negative you'll need to check whether to round up or down to get the integer part.
Bob
I am sure what you mean here. Can you show me how this is done?
Offline
The int function rounds all numbers down to the integer below the number.
Eg int(1.5) = 1
Int(1) = 1
Int(-1.5) = -2 not -1
For these questions, first you have to half the x input. Then apply the int function to the result.
Eg f(4.6) = int(2.3) = 2
f(-8.4) = int(-4.2) = -5
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
The int function rounds all numbers down to the integer below the number.
Eg int(1.5) = 1
Int(1) = 1
Int(-1.5) = -2 not -1
For these questions, first you have to half the x input. Then apply the int function to the result.
Eg f(4.6) = int(2.3) = 2
f(-8.4) = int(-4.2) = -5
Bob
Let me see.
a. f(1.2)
f(x) = int(x/2)
f(1.2) = int(1.2/2)
f(1.2) int(0.6) = 0
b. f(1.6)
f(1.6) = int(1.6/2)
f(1.6) = int(0.8) = 0
c. f(-1.8)
f(-1.8) = int(-1.8/2)
f(-1.8) = int(0.9) = 0
You say?
Offline
A and b good.
C error. Half -1.8 is minus
Bob
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
A and b good.
C error. Half -1.8 is minus
Bob
c. f(-1.8)
f(-1.8) = int(-1.8/2)
f(-1.8) = int(-0.9) = -1
You say?
Offline
Now correct.
B
Children are not defined by school ...........The Fonz
You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you! …………….Bob
Offline
Now correct.
B
Perfect.
Offline
Pages: 1