A gentle puzzle I was just asked.
-
Smallest positive integer = 1 Largest negative integer = -1 Difference is 2.
Largest negative. I had not noticed that. Reading correctly is half the battle. :thumbsup: Well done :suss:
Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
1 is smallest positive integer -infinity is largest negative integer 1 - (-infinity) is 1 + infinity is infinity oops my coffee cup is overflowing
"A little time, a little trouble, your better day" Badfinger
I fell for the same. -1 is larger than -10. The largest negative integer is -1. Infinity isn't in this game. Made me feel stupid and I loved it :thumbsup:
Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
-
I fell for the same. -1 is larger than -10. The largest negative integer is -1. Infinity isn't in this game. Made me feel stupid and I loved it :thumbsup:
Bastard Programmer from Hell :suss: "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
All depends on one's definition of largest negative integer. The largest integer that is negative or the largest negative integer compared to all negative integers. The problem as stated is missing this clarity.
"A little time, a little trouble, your better day" Badfinger
-
This was my answer as well. Both the smallest positive and largest negative integers are 0. But I can see the case for both 2 and Infinity. Brent Hoskisson
Brent
Mathematically, zero is neither positive or negative ... :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Oh? Is -2 bigger than -1 now? :-D
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
For sure: if I have -$2, I owe the bank more than if I had -$1. $2 is a larger number, indicating a larger debt.
------------------------------------------------ If you say that getting the money is the most important thing You will spend your life completely wasting your time You will be doing things you don't like doing In order to go on living That is, to go on doing things you don't like doing Which is stupid. - Alan Watts https://www.youtube.com/watch?v=-gXTZM\_uPMY
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Silly me was thinking in Int32.
Wrong is evil and must be defeated. - Jeff Ello
-
Check this out. It's JavaScript but...
Number.MIN_VALUE < -1 // true
Number.NEGATIVE_INFINITY > -1 // false
// a little clearer
-1 > Number.NEGATIVE_INFINITY // TRUESo the largest negative integer is -1. :thumbsup:
I think it's a bad mistake to assume that a computer implementation of a mathematical concept provides a correct definition, especially at the limits. But I agree that mathematically -1 is larger than -2. It's the distance from the extreme left of the number line (-infinity) that illustrates this. And zero is neutral, neither positive nor negative. And we're relying on ChatGPT for truth now? Lord help us!
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
This should clear things up. Integer - Wikipedia[^]
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
The smallest positive integer is either 0 or 1 depending on whether 0 is considered positive or not. The largest negative integer is -1. So the answer is 1 or 2. This is not the intent of question but that is the correct answer given how the question was worded.
-
MarkTJohnson wrote:
The largest negative integer is the negative integer that is greater than all other negative integers.
I thought the same thing. Also, isn't it interesting that on the other side of 0 that no one had a problem distinguishing the smallest positive integer : which is 1. Aren't all numbers greater than others when the are further to the right of other numbers? Also, do these people not believe that following are true? -5000 < -1 -1 > -5000 Then why don't they know that the largest negative integer is -1?
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
You have to define 'largest'.
-
You have to define 'largest'.
I don't - we have dictionaries to do that: :-D
Quote:
largest Definitions from the GNU version of the Collaborative International Dictionary of English. (adjective) Greatest in size of those under consideration. (adjective) maximal. from Wiktionary, Creative Commons Attribution/Share-Alike License. (adjective) Superlative form of large: most large.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
Since this is a coding site here are the possibilities for a 32-bit int.
#include #include int main()
{
int pos = 1;
int neg = INT_MIN;
printf("pos=%d neg=%d\n", pos,neg);
printf("pos+neg=%d\n", pos+neg);
printf("pos-neg=%d\n", pos-neg);
printf("neg+pos=%d\n", neg+pos); // yes I know it's commutative but here for completeness
printf("neg-pos=%d\n", neg-pos);
return 0;
}pos=1 neg=-2147483648
pos+neg=-2147483647
pos-neg=-2147483647 // Hmmm...this seems wrong -- subtracting negative SHOULD add it.
neg+pos=-2147483647
neg-pos=2147483647 -
Is zero positive?
Depends on context. See Is zero positive or negative?
Bond Keep all things as simple as possible, but no simpler. -said someone, somewhere
-
What is the smallest positive integer minus the largest negative integer?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!
-
Smallest positive integer = 1 Largest negative integer = -1 Difference is 2.
This person is absolutely correct. In the field of mathematics, the largest negative integer is -1. Therefore 1 - (-1) would indeed be 2.
-
Smallest positive integer = 1 Largest negative integer = -1 Difference is 2.
My brain went to 2s complement, and also considers largest negative int to be -128 for 8 bits, -32768 for 16 bits. As someone else said, my creditors consider think I owe them a larger amount if it's $32,768 instead of $1. But then my brain fried.... I know it would over or underflow, but exactly how? Hmm.... I've spent so many years programming to avoid such overflows that I no longer remember. Does it depend on the compiler? C# example: Int16 a = 1; Int16 b = -32768; Int16 c = (Int16)(a - b); C winds up being -32767, which means it wound up doing the 16 bit equivalent of (0001 - 1000) = 1001 in binary. The LSB being one makes sense to me. The MSB being one is not so obvious.
-
Depends on context. See Is zero positive or negative?
Bond Keep all things as simple as possible, but no simpler. -said someone, somewhere
Zero is definitely not negative. And it's not imaginary either. If it's neither positive nor negative, then it must also be neither imaginary nor real. If we accept zero as a real, then we must conclude that zero is positive.