C
C#•3mo ago
chockbar de bz

adding a double and a float

hello i was following the course of the server for c# and the people in the video added a float and a deciaml together without changing their nature but when i do it i have an error,why ? ( i know its bad to add them together because it will create mistakes and i am not planning to i just want to know why does it work for them and not me ?)
No description
No description
6 Replies
ero
ero•3mo ago
look again
chockbar de bz
chockbar de bzOP•3mo ago
i dont see it 😅
ero
ero•3mo ago
No description
No description
chockbar de bz
chockbar de bzOP•3mo ago
ohhhhh ok thx
ero
ero•3mo ago
the important bit here is that the result is a double, not a float, which would be a lossy conversion and needs to be explicitly cast, if you want to do it $close
MODiX
MODiX•3mo ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?