How to calculate the sine of 1? like sin(1)
(Although sin(1) is statically known, so you might as well just replace it with the actual value).
thanx! but i cant find the way to calculate it anyway. i just started to learn swift and i got a task to improve my skills in google solutions of tasks we have not yet studied. so i have to find the sine of 1 using Swift. i found how to calculate sine of 90 degrees but i cant find how to calculate sine of 1
and should i also import smth before calculating sine of 1?
The Standard Library (which is the one you implicitly use when working with arrays, calling
You can alternatively use the one provided in
import Foundation sin(1.0) // returns 0.8414709848078965
yeeeeeeees !!!!! it worked!!! thanx!!!
Even though you got an answer now, I would encourage you to actually spend at least an hour or two trying to research these things for yourself instead of asking others. Especially if the assignment is explicitly about googling things. Being able to find solutions in areas you're not closely familiar with is (imo) one of if not the most important skill a programmer can have, and you won't get better without actually doing it.
thanx for advise. i spend a lot of time to find solution, but failed. i thought that to find the answer on a forum is the same thing as googling. but i guess now you are right, i have to google better