The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
To make it even worse, it's not even the same in all languages, and to make that even worse there are languages that didn't even make a choice which way to do it (you have already guessed which languages that were).
There's a nice list at the right side of the relevant wikipedia page, which is interestingly the Modulo operation page while the point is that in most languages it's really the remainder operation.
I don't think this is really wrong.
This is probably due to confusion between modulo and remainder.
There seems to be the same for positive numbers.
But for negative numbers, there are different.
Remainder work as expected.
But modulo work as following: returns the difference of the first number, and the biggest integer (possibly negative) multiple of the second number that is less than the first number.
So in our example: -1 - -20 = 19
That's why lot of programming languages have 2 "modulo" operators, one for modulo operations and one for remainder operations.
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
Having given this some thought... I have come to the conclusion that the argument that the remainder must never be negative must make sense only to they who realllllly don't like improper fractions and consider negative fractions to be improper.
But I have not found anything explaining why someone would feel that way. I have a guess, but no way to confirm it.
In 2013, Bernanke wrote that virtual currencies “could have a long term promise”, and addressed his thoughts to congress. However, more recently in 2015, Bernanke also said that there were some “serious problems” with virtual currencies, including issues with anonymity and the lack of stability.
OK, no more blockchain posts for a while now, at least from me
next Tuesday, 50 leaders representing the business, technology, government, academia, arts and non-profit sectors arrive on Sir Richard Branson’s private island to spend three packed days discussing blockchain technology for the third annual Blockchain Summit....“We’re trying always to invite the biggest thinkers of this world and discuss how we can use this technology to really do good,” said Bitfury chief executive Valery Vavilov.
Actually, the title is a little misleading. I accidentally ran across something that will crash the compiler process which runs separately from the IDE. It's not that big a deal but it seems to be repeatable. This will happen when you put an invalid entry in the initialization list of a class constructor. For example :
: BaseClass( defaultArg )
, m_ValidMember( 0 )
, m_InvalidMember( 0 ) // <- this will cause the crash
As anyone else run across something like this or other ways to cause mayhem with VS17?
What, you expect MS to stop working on the next half-baked version to fix an old bug???
Since VS2010 they've stopped doing that, 13 is relatively stable (but has issues ms simply ignored because they were rushing out 15), 15 has even more issues ms simply ignores because they are already working on the next.
You can bet on the next version (VS2019?) still having that exact same problem.
Once upon a time ms [mostly] finished software before release, but since the new mgmt that is no longer the case - and that's across the entire product range. A bad habit they took from google.
Just be happy ms/google etc don't build planes or self driving cars and ... oh elephant
Dropped keys in car and had to stretch an contort to fish them out from under the seat, then, walking up the stirs with coffee, I took a bit of a misstep, lurching forward with associated mess. Meanwhile, just a bit later, Mrs. calls me on cell (flip phone) - which flipped out of my hands and into a nearby urinal. The phone model is discontinue ($20 LG B450) but can be had for $80. Aside from that, even if it starts to work again when it dries out, do I really want to put it up to my face?
So far, I've navigated the last hour safely, but the day is still young and there's the trip home.
So... based on the procedures where I work:
You should not be carrying liquids on the stair case; always maintain 3 points of contact.
When using the restroom, concentrate on what you're doing; a phone call or text can wait.
A very peaceful is to be had when you take out your phone and leave it on the desk, not just going to the toilet but lunch / tea breaks too. Young ones may not know this, but once upon a time this is how it was done ... not by choice, but by the limitations of technology ... and the world kept on spinning just fine without everyone being tethered to a stupid phone 24/7, in fact the world spun a lot smoother than now.
Any important calls (definition of important should be much it matters to you, not the caller), you can see the number(s) that came in ...
If the caller thinks it's urgent they will sure 1. call many times, 2. send a text or email, or 3 = 1 + 2.
Really who gives a elephant: phones are tools to help us, not chains to bind us. Often weekends I'll go out without the stupid thing at all.