Ask Question
18 September, 08:44

How can I convert a number that is a double to a long?

+1
Answers (1)
  1. 18 September, 08:55
    0
    double data type contains: 8 bytes

    long data type contains: 8 bytes

    We can convert double to a long using Type casting.

    When we want to convert from one data type to another data type we use Type Casting. For example, if we want to store a lengthy value (double, long) in a integer, we can type int (data type) Variable. Using the cast operator, you can explicitly convert values from one type to another. In c language, there are two kinds of type casting that are Implicit conversions and Explicit Conversions.

    Example-

    double x = callingFunction ();

    / / Now typecast

    ing

    long y = (long) x;
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “How can I convert a number that is a double to a long? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers