Ask Question
25 August, 06:49

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

+1
Answers (1)
  1. 25 August, 07:57
    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?
Get an answer to your question ✅ “How can I convert a number that is a double to a long? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers