Top "Type-conversion" questions

Type conversion is the way of implicitly or explicitly changing an entity of one data type into another.

Explicit Type Conversion in Scala

Lets say I have the following code: abstract class Animal case class Dog(name:String) extends Animal var foo:Animal = …

scala type-conversion
How to output a character as an integer through cout?

#include <iostream> using namespace std; int main() { char c1 = 0xab; signed char c2 = 0xcd; unsigned char c3 = 0xef; …

c++ io type-conversion iostream outputstream
converting int to uint8_t

is it a correct way to convert an int value to uint8_t: int x = 3; uint8_t y = (uint8_t) …

c int type-conversion uint8t
NumPy or Pandas: Keeping array type as integer while having a NaN value

Is there a preferred way to keep the data type of a numpy array fixed as int (or int64 or …

python numpy int pandas type-conversion
Convert several columns from integer to numeric in R data.frame

I would like to convert columns from 2 to 13 (the last one) from integer to numeric. For one column, I use …

r type-conversion lapply
How to convert a bool to a string in Go?

I am trying to convert a bool called isExist to a string (true or false) by using string(isExist) but …

go type-conversion
2 bytes to short java

i'm reading 133 length packet from serialport,last 2 bytes contain CRC values,2 bytes value i've make single(short i think) using …

java type-conversion byte core short
byte operations (XOR) in python

#!/usr/bin/env python3 import binascii var=binascii.a2b_qp("hello") key=binascii.a2b_qp("supersecretkey")[:len(var)] …

python encryption byte type-conversion operation
Convert int to BigDecimal with decimal - Java

I'm having a hard time figuring out how to convert this. Here is what I want: int i = 5900; BigDecimal bD = …

java type-conversion bigdecimal
Convert.ToBoolean fails with "0" value

I'm trying to convert the value "0" ( System.String ) to its Boolean representation, like: var myValue = Convert.ToBoolean("0"); // throwing an exception …

c# types reference value-type type-conversion