|
00:11
johnjaye joined
00:34
johnjaye left
00:35
johnjaye joined
00:41
johnjaye left
00:45
johnjaye joined
01:07
melezhik_ joined
01:10
melezhik_ left
|
|||
| Voldenet | librasteve: tl;dr the explanation is what I initially thought and it's completely wrong :D | 01:30 | |
| tellable6 | Voldenet, I'll pass your message to librasteve_ | ||
| disbot6 | <antononcube> About mod and % ? | ||
| Voldenet | yeah, I thought too that it was the remainder vs true modular arithmetics | ||
| but it's just nonsensical that for some values it behaves differently | 01:31 | ||
| but for some mod is the same as % | |||
| (I mean, -7 % 1.9 vs -7 mod 2.1) | 01:32 | ||
| erm, 7 % 1.9, 7 mod 1.9, etc | |||
| -7, even | |||
| disbot6 | <antononcube> This reminds that I have put more tests in "Math::NumberTheory". Modular arithmetic is, of course, too central. | ||
| Voldenet | but I'm guessing that it's temporary | 01:34 | |
| I see no reason for not using % (which, as one would expect, always returns the value in range `[0, divisor)`) | 01:36 | ||
| disbot6 | <antononcube> I think this goes to the defintion of mod. | 01:41 | |
| <antononcube> Let me find an example and/or explanation. | 01:42 | ||
|
01:47
arkiuat left
|
|||
| Voldenet | no, it's not that | 01:48 | |
| m: with -7.7 -> $a { .say for $a % 2.1, $a mod 2.1, $a % 1.9, $a mod 1.9 } | |||
| camelia | 0.7 0.7 1.8 5.6 |
||
| Voldenet | 5.6 simply doesn't make sense | 01:49 | |
| disbot6 | <antononcube> Ok, and yes. | 01:50 | |
|
01:51
arkiuat joined
|
|||
| disbot6 | <antononcube> I think this is a explanation: -7 * 1.9 + 5.6. | 01:55 | |
|
01:56
arkiuat left
|
|||
| disbot6 | <antononcube> Now, -7 comes from div: -7.7 div 1.9 == -7. | 01:56 | |
| <antononcube> So, div and mod are consistent in this case. | 01:57 | ||
| <antononcube> I think the expectation is -7.7 div 1.9 to give -5. | 01:58 | ||
| <antononcube> It might be that div is the culprit. | 02:00 | ||
| Voldenet | yes | ||
| it is | |||
| I pasted yesterday this juicy line github.com/rakudo/rakudo/blob/main...kumod#L144 | 02:01 | ||
| disbot6 | <antononcube> Cool1 | 02:02 | |
| <antononcube> Damn, you "derailed" me! I have some Python programming to do. (Which I am payed for.) | 02:03 | ||
| <antononcube> Not dealing with Raku numerics. (Which rarely someone is willing to pay for...) | |||
|
02:05
hulk joined
02:06
kylese left
02:10
arkiuat joined
|
|||
| Voldenet | :p | 02:15 | |
|
02:15
arkiuat left
|
|||
| Voldenet | sorry – to my defense, I've also derailed myself | 02:15 | |
| disbot6 | <simon_sibl> can zef install packages from cpan directly ? I wanted to download Spreadsheet::Read but it doesnt find it (even with --cpan flag) Also I guess it would then install that package in the Raku modules path and not in the Perl5 module path ? | 02:17 | |
| Voldenet | if you mean perl5 packages, then probably you'd have to use cpanm or cpan | 02:26 | |
|
02:29
arkiuat joined
02:38
arkiuat left
02:43
johnjaye left
02:45
arkiuat joined,
johnjaye joined
02:48
Aedil joined
|
|||
| disbot6 | <simon_sibl> I see, indeed I meant perl5 packages, thanks at least I am sure now 🙏 | 02:52 | |
|
03:15
hulk left,
kylese joined
04:41
melezhik_ joined
04:43
melezhik_ left
04:49
lichtkind__ joined
04:51
lichtkind_ left
|
|||