You are not logged in.
Pages: 1
Hy all ,
Since i am trying to detect slow and fast motion of my moving object . ,Conceptually , When i move slow then my current and previous motion almost about near ,., not much difference ... so probably less difference and speed would be low . .
but if i move fast then more distance will cover at the same time . so speed will be more .
But some time i get distance some thing like
get this value
Distance : 1.1219e+006
speed :47.1996
Distance : 1.1219e+006
speed :47.1996
Distance : 1.1219e+006
speed :47.1996
Distance : 1.1219e+006
speed :47.1996
Distance : 1.1219e+006
speed :47.1996
i do't understand this reason .
any one could guide me please thanks
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
hi model
Distance : 1.1219e+006
Is this what is bothering you?
This is called standard index form.
It is used for very large or very small numbers.
Is that what you wanted?
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
yes so i think i should try to handle very large and very small numbers . but any idea how ?
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
What computer language?
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
I am using c++
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
hi model,
C++ will give you floating decimal forms for numbers unless you specify otherwise.
A short integer will only go up to 32,767,
and a long integer to 2,147,483,647.
But as you want to do calculations involving distance / speed / time the floating form is probably best.
So you probably don't need to do anything in order to handle very large or very small numbers.
Do you want to output numbers to the user in a more readable form?
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
yes .. I want output in more readable or understandable form for user .
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
since i am using double for speed and distance . and this output
Distance : 1.1219e+006
speed :47.1996
is terrible or not understandable specially for me .
so i want the output that user should easy to understand . and also should work for my project requirement .
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
Hy Bob ,
if floating point i meant double is best to use then how to get rid from very large and very small numbers ???
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
hi model
I'm not familiar with the code for this.
Can you just do the calculations in 'double' then set a new integer variable equal to the answer and output this?
ELSE
Convert 1.1219e+006 to a 'string' , split it into '1.1219' then 'e' then '006'.
Then construct an integer by 1.1219 x 10^006
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
ah you meant do calculation in double but show your ans in int form by casting double to int .
I see.. ok Thanks Bob .
Maths is Doctor that make our life easy ..
https://www.facebook.com/groups/Maths.GIS/
Offline
Pages: 1