N
N
Nickilanto2018-08-02 14:17:04
C++ / C#
Nickilanto, 2018-08-02 14:17:04

How to reduce a number in a period?

In general, the essence is as follows, there is a certain variable U Which should be assigned the value U = 3/180 , so when this variable is displayed, all data types known and unknown to me give out 0.000 (although in theory it should be 0.016), what to do with this - I don't understand, can anyone tell me what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2018-08-02
@Nickilanto

Well, 3/180 is how you operate with integers. Hence and 0 as a result. Try 3.0/180. Or 3/180.0.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question