How to use % in an arithmetic combinator?
How to use % in an arithmetic combinator?
I do not understand how percent works in an arithmetic combinator. Please explain me
My native language is russian. Sorry if my messages are difficult to read.
Re: How to use % in an arithmetic combinator?
42 ÷ 10 = 4 remainder 2
42 / 10 = 4
42 % 10 = 2
42 / 10 = 4
42 % 10 = 2
Re: How to use % in an arithmetic combinator?
What am I doing wrong? Why does not 2 come out?DaveMcW wrote:42 ÷ 10 = 4 remainder 2
42 / 10 = 4
42 % 10 = 2
My native language is russian. Sorry if my messages are difficult to read.
Re: How to use % in an arithmetic combinator?
Why is not 10% coming output?DaveMcW wrote:42 ÷ 10 = 4 remainder 2
42 / 10 = 4
42 % 10 = 2
My native language is russian. Sorry if my messages are difficult to read.
Re: How to use % in an arithmetic combinator?
You are calculating 6 % 20, which results in 6 (6 / 20 = 0, remainder 6)WIZ4 wrote:What am I doing wrong? Why does not 2 come out?DaveMcW wrote:42 ÷ 10 = 4 remainder 2
42 / 10 = 4
42 % 10 = 2
You need to swap them in the combinator to set it to 20 % 6, which results in 2 (20 / 6 = 3, remainder 2).
Re: How to use % in an arithmetic combinator?
This is the remainder of the division, not percents.WIZ4 wrote:I do not understand how percent works in an arithmetic combinator. Please explain me
Это остаток от деления, а не проценты.
Re: How to use % in an arithmetic combinator?
Exactly. If you want 20% of the input you would multiply by .20
6 * .20 = 1.2
If you cannot do decimal, you could do more combinators:
6 * 20 / 100 = 1.2
6 * .20 = 1.2
If you cannot do decimal, you could do more combinators:
6 * 20 / 100 = 1.2
Re: How to use % in an arithmetic combinator?
It's not possible directly with combinators. They operate with integers only. There should be two combinators as in your second example.nevniv wrote:Exactly. If you want 20% of the input you would multiply by .20
6 * .20 = 1.2
Re: How to use % in an arithmetic combinator?
Tip: always multiply before dividing. Integer division causes a loss of precision.hitzu wrote:There should be two combinators as in your second example.nevniv wrote:6 * 20 / 100 = 1.2
6 * 20 / 100 = 1 (result rounded down from 1.2)
6 / 100 * 20 = 0 (because 6/100 is rounded down to 0 first)
Re: How to use % in an arithmetic combinator?
The % is not PERCENT.
it is like dividing by the givven number and return the remainings. There are only full numbers used like thet:
2 % 2 =0 remaining (2 / 2= 1which is just dumped, )
3 % 2 = 1 remaining (3 / 2 = 1which gets dumped again but now we get 1 remaining)
4 % 2 = 0 remining
it is like dividing by the givven number and return the remainings. There are only full numbers used like thet:
2 % 2 =0 remaining (2 / 2= 1which is just dumped, )
3 % 2 = 1 remaining (3 / 2 = 1which gets dumped again but now we get 1 remaining)
4 % 2 = 0 remining
Re: How to use % in an arithmetic combinator?
I understand, thanks for explaining
My native language is russian. Sorry if my messages are difficult to read.