-3

I have a task to create a mathematical formula in c++, input some variables and get a result.

The problem is that I don't know how to represent and calculate the following:

sin(3 mod 180)

I`m aware that mod operator finds the remainder of a division. I can figure that out for 180 mod 3, but for 3 mod 180.

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
Vallerious
  • 570
  • 6
  • 13

1 Answers1

1

C++ and standard C library provides methods for most arithmetic operations std::sin being one of them. You can do mod using modulo operator.

I.e. std::sin(3 % 180)

Jarod42
  • 203,559
  • 14
  • 181
  • 302
aks
  • 720
  • 4
  • 9