Using truncatingRemainder for Integers

I have started learning Swift recently and got a problem with truncatingRemainder function. why can't I use it with integers? the console returns me an error

There is no truncatingRemainder function for integers. You can use the % operator.

thanks a lot bro!
and if it's not a problem for you, can you explain please, why does the console return an error when I create an empty const:

As the error suggests, that's a special limitation of using let at the top level of a playground.

Terms of Service

Privacy Policy

Cookie Policy