Conversion from Long to Double in Java

前端 未结 8 440
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 01:07

Is there any way to convert a Long data type to Double or double?

For example, I need to convert 15552451L to a

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 01:40

    You can try something like this:

    long x = somevalue;
    
    double y = Double.longBitsToDouble(x);
    

提交回复
热议问题