Link to home
Start Free TrialLog in
Avatar of PearlJamFanatic
PearlJamFanatic

asked on

converting long to double

I have to store a value(time since 1970 in milliseconds) in a custom map. The methods that i could use are setDouble(index, double) and setInt(index, int). Sadly there isn't a setLong(). I tried storing as int, after casting the long to int, but it is loosing information. Can I absolutely sure that casting the long to double will not lose information? Please give me the code
long Value is 1495695600000
Avatar of PearlJamFanatic
PearlJamFanatic

ASKER

and what happens when I convert it back to long? Because some methods take long values.
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.