S
S
swyt2020-06-14 19:06:51
C++ / C#
swyt, 2020-06-14 19:06:51

How to round down to the smallest integer?

I need to write down its rounded value to the c variable. But this code doesn't work. Why?
с = Math.Floor(c);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Timur Pokrovsky, 2020-06-14
@Makaroshka007

Because Ceiling rounds up. Use Math.Floor(c)

E
Evgeny Zaletsky, 2020-06-14
@JZ_52

Code please. Here is some documentation that might help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question