Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-09-2009
Member
 
Join Date: Jul 2009
Posts: 124
Warning C4244: possible loss of data

Quote:
warning C4244: 'argument' : conversion from 'double' to 'float', possible loss of data
I am getting the above error message when I am trying to convert 'double' to 'float'. I tried typecasting but it did not work. Any help is appreciated.
Reply With Quote
  #2  
Old 03-09-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Warning C4244: possible loss of data

This is obvious because you are trying to convert a higher level of datatype into lower which may lead you into data loss. This message tells you that the double holds larger amount of data then float can which might result you in data loss. If you still want to move further then it is better to use explicit typecasting.
Reply With Quote
  #3  
Old 03-09-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Warning C4244: possible loss of data

Basically with this warning, the compiler wants to tell you that since double handles 8 byte of data while float only handles 4 byte of data, the implicit conversion may result you in data loss. If you still want your variable or expression to convert to lower datatype, you need to explicitly mention the proper datatype for typecasting.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Warning C4244: possible loss of data"
Thread Thread Starter Forum Replies Last Post
Want help to avoid data loss in HP touchpad. Choo-Kheng Portable Devices 6 19-07-2011 10:34 AM
Need Help To avoid data loss while on net Roger Zelazny Networking & Security 5 01-03-2011 10:18 PM
What are causes of data loss? Frieda Operating Systems 5 18-02-2011 02:53 PM
What to do when Data Loss happens? sivaranjan Windows Software 6 01-04-2010 09:23 AM
Data Loss on RAID Ravi Singh Operating Systems 3 28-08-2009 11:47 PM


All times are GMT +5.5. The time now is 02:41 AM.