A
A
Aleksandr Govorukhin2016-02-24 17:41:39
Swift
Aleksandr Govorukhin, 2016-02-24 17:41:39

Missing Int64 in swift2?

Hello, friends!
While playing in the playground, I ran into a problem, namely:
There is a certain sequence of numbers:

let arrayNew = "887 * 10 * 7 * 6461 * 8627 + 122 * 4 + 3 * 8235 * 5 + 422 + 549 * 5578 * 33 + 32 * 9464 * 4282 * 4696 * 3776 + 5 + 10 + 7 * 7 * 87 + 256 + 77 * 829 + 773 + 7 * 8 * 163 * 407 + 5 + 96 + 535 + 7 + 7 + 4 * 4101 + 587 * 4 * 18 + 242 + 55 * 2573 * 6895 * 789 + 99 + 7407 + 5 + 5273 + 1 % 1143"

which must be multiplied one after another (not like in mathematics (first multiplication...)), so, it happened that my numbers went beyond the bounds of the possible, is there something bigger than Int64? Maybe third party libraries or something like that? Previously, I did not encounter such a problem and did not ask such a question.
I hope you can help me and explain what is the best way to act in such a situation.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
ManWithBear, 2016-02-24
@SnapSh0t

The result should be the remainder of the division by 1143?
UPD. You are interested in modular arithmetic. For example here -> CLICK!

S
sergski, 2016-02-24
@sergski

When not using negative ones, you can use UInt64

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question