Why is 65536 an important number?
65536
Miscellaneous Forums/General Discussion/65536 or maybe 65535.
Highest value a 16-bit unsigned number can hold.
(which I believe they call a short?)
(which I believe they call a short?)
That makes sense. No wonder I've seen it so many times since I've been coding. Thanks.
255 is short,
65535 is integer,
4294967296 is long integer etc
65535 is integer,
4294967296 is long integer etc
EdzUp depending on the language ints are considered 32 or even 64 bits
It's basically FFFF in hex which is also -1 if signed. I used to be very aware of this number in my 16-bit days. Nowadays it's slightly harder to remember 4.2billion-odd for 32-bit computing.
255 is short,
65535 is integer,
4294967296 is long integer etc
65535 is integer,
4294967296 is long integer etc
I'm not sure what platform you're referring to, but on 32-bit PCs:
255 = 0xFF is a byte (8 bits)
65535 = 0xFFFF is a short (16 bits)
4294967295 = 0xFFFFFFFF is an integer (32 bits)
18446744073709551615 = 0xFFFFFFFFFFFFFFFF is a long integer (64 bits)
Yah bytes are typically 8-bit. Sometimes short is a `word` and usually 32-bit is an int (or a long word).
I seem to remember 16777216 (i think) is the range of colors in a 24-bit color palette.
I seem to remember 16777216 (i think) is the range of colors in a 24-bit color palette.
shorts/ints/longs are subject to change. It's best to refer to the value based simply on the number of bits/bytes involved.
Let throw the spanner into the works. The size of and int or a word depend on the architechure of the processor.
Here's a link http://en.wikipedia.org/wiki/Integer_%28computer_science%29
Here's a link http://en.wikipedia.org/wiki/Integer_%28computer_science%29
I remember the C64 days, I had all the "round" hex-numbers as decimals in my head then.
Machinecode (assembler) always used Hex for adressing
but the Basic of the C64 understood only Decimal numbers.
To start a program at $1000 you had to write SYS4096
at the Basic prompt...
65536 where the total availible memory of the C64.
Ahh, those were the days............
Machinecode (assembler) always used Hex for adressing
but the Basic of the C64 understood only Decimal numbers.
To start a program at $1000 you had to write SYS4096
at the Basic prompt...
65536 where the total availible memory of the C64.
Ahh, those were the days............
im refering to C, the version I have here (16-bit) shorts are 0-255 or -127 to 128
the reason 65536 is important is that 0-65535 has 65536 combinations (inc 0)
I know it from a limit of the number of lines you can have in excel.
@EdzUp - why would a 16-bit space only contain a byte's worth of data? (8-bit, $FF, %11111111, 0-255)
I believe someone is remembering wrong definitions...
I believe someone is remembering wrong definitions...
It's 64K, the max amount of memory addressable by a lot of 8 bit computers.
And Bill Gates once said "nobody will ever need more than 64K Ram". This probably delayed the introduction of 24 or 32 Bit adressing, resulting in "segmented" memory, what a crap. The whole memory was segmented in 64K blocks, and to access any data one had to call both, segment and adress of a certain byte. These were 16 Bit Operating Systems (until Win95).
And Bill Gates once said "nobody will ever need more than 64K Ram"
This has been shown to be an urban legend/myth. (And it was 640kb he supposedly said!)There are other reasons for segmented memory, we did it on our exam. I can't remember them right now though.
EdzUp - why would a 16-bit space only contain a byte's worth of data? (8-bit, $FF, %11111111, 0-255)
Turbo C++ 5.5 (DOS version) came out before they changed to byte, you only had short, int, long, float, double, char. No byte that came later.
To me short would always be 0-255 or -127 to 128, I come from a C background before they standardised everything.
it's puki's amount of media files
It all depends on the architecture what constitutes a short, int or long.
2 or more bits can be classed as an "XX 'bit word'" (not to be confused with a standard "word" being 2 bytes)", i prefer this terminology, is hardware/architecture independent.
2 or more bits can be classed as an "XX 'bit word'" (not to be confused with a standard "word" being 2 bytes)", i prefer this terminology, is hardware/architecture independent.
CS_TBL was correct at the time of writing, but he's way off the mark now.
240676 is an important number to me. It's my date of birth.
..important number is one on my bank account..
65536 is the number dyslexic satanists ( aka computer programmers ) use :-)
I hope you've only been coding for a few months if you didn't know this.
I posted it to spur discussion.
You can't even begin to imagine how much your arrogance gets under my skin Noel. Nevertheless, it thrills me to know that you are still here after all these years.
You can't even begin to imagine how much your arrogance gets under my skin Noel. Nevertheless, it thrills me to know that you are still here after all these years.
@EdzUp:
Sorry, I misread your post. I thought you meant 16-bit was 0-255 in your old C language, but you probably meant your old C language was 16-bit and they named 8bit variables 'short'.
Turbo C++ 5.5 (DOS version) came out before they changed to byte, you only had short, int, long, float, double, char. No byte that came later.
To me short would always be 0-255 or -127 to 128, I come from a C background before they standardised everything.
To me short would always be 0-255 or -127 to 128, I come from a C background before they standardised everything.
Sorry, I misread your post. I thought you meant 16-bit was 0-255 in your old C language, but you probably meant your old C language was 16-bit and they named 8bit variables 'short'.
You can't even begin to imagine how much your arrogance gets under my skin Noel.
I can't even begin to imagine how seriously you take all this. I don't think pointing out a rather gaping and obvious void in your knowledge equates to arrogance, TBH.
Again, I'm well aware of what the number is and what it means. Feel free to test my knowledge if you are certain there's a gaping obvious void there.
Then, why did you ask?
Either you're too lazy to scroll up a bit or you're just here to dumb down the thread a bit more.
Again, I'm well aware of what the number is and what it means. Feel free to test my knowledge if you are certain there's a gaping obvious void there.
Ok, then why did you say..
That makes sense. No wonder I've seen it so many times since I've been coding. Thanks.
When people answered your question. If you already knew and were testing people, wouldn't it have made more sense to say "that's correct, well done" ?
on a similar note
why do we have 32bit (and iir larger) scanners when we use r g b (which are going to give 'odd' numbers like 24 bit)
i know (or think this is why) 32 bit colour is using a 4th channel for alpha stuff ... but a scanner
and hd tv's that boast way more colours than 24bits 16777216 ... come now can the human eye really tell the difference between $FFFFFF and $FFFFFE ???
ok i could look it up but im not that bothered tbh ;)
i was going to make a 24bit to 12bit (amiga ham 4096) jpeg converter to see what the diference would be
but in uncompressed bmp im still using the same ammount of video ram so i thought 'why bother'
(mind you a pure white .bmp would be the same as a multi coloured picture so my initial argument was moot its the compression that matters)
edit:
i have started making a .pal file for psp that has the first line of 16 as $000000 the next as $111111 etc all the way up to $FFFFFF (if pal files gave hex values it would be so much quicker now i have to find out what AA is in dec etc)
then im going to make a 'c64ish' 64 colour pallet too
might post some random pix with each option done
afaik all i have to do is split to rgb creating a grey scale
load in new pallet 3 times and merge and bobs your uncle a total waste of my time
why do we have 32bit (and iir larger) scanners when we use r g b (which are going to give 'odd' numbers like 24 bit)
i know (or think this is why) 32 bit colour is using a 4th channel for alpha stuff ... but a scanner
and hd tv's that boast way more colours than 24bits 16777216 ... come now can the human eye really tell the difference between $FFFFFF and $FFFFFE ???
ok i could look it up but im not that bothered tbh ;)
i was going to make a 24bit to 12bit (amiga ham 4096) jpeg converter to see what the diference would be
but in uncompressed bmp im still using the same ammount of video ram so i thought 'why bother'
(mind you a pure white .bmp would be the same as a multi coloured picture so my initial argument was moot its the compression that matters)
edit:
i have started making a .pal file for psp that has the first line of 16 as $000000 the next as $111111 etc all the way up to $FFFFFF (if pal files gave hex values it would be so much quicker now i have to find out what AA is in dec etc)
then im going to make a 'c64ish' 64 colour pallet too
might post some random pix with each option done
afaik all i have to do is split to rgb creating a grey scale
load in new pallet 3 times and merge and bobs your uncle a total waste of my time
I've read the thread. What's your point?
I know it as a mersenne number and it also comes up frequently as a port and in SQL. Never realized it's also "the highest value a 16-bit unsigned number can hold". This thread has taken a turn for the worse!
... This is not what I intended.
I was only asking. :)
and hd tv's that boast way more colours than 24bits 16777216 ... come now can the human eye really tell the difference between $FFFFFF and $FFFFFE ???
I can't be bothered to look it up either, but I vaguely recall reading that RGB is actually a very bad representation of color as the human eye perceives it. As such, certain areas of the color scale contain far greater variance in colors than other ranges of the same numerical size.
In other words, while you may not be able to distinguish between two shades of red in 8 bit per channel RGB, you may be able to clearly distinguish between two particular shades of green.
In terms of 32bit versus 24bit, I think the extra 8 bits are just thrown away. I think we just went to 32bit because that's what processors use so it's quicker to get it as 32 bits. In order to get any visible difference from 24 bit, I think you have to go up to 48 bit, or 16 bits per channel. And I expect alpha comes into play for some things.
Again, I might be wrong, but I think this one of the reasons why print always uses the CMYK color model in place of the RGB. The other being that CMYK works from a base color of white and you're usually printing on white paper, whereas RGB works from a base color of black.
thing is though isnt video ram uncompressed
so a 24bit screen no matter how many colours on screen would be big
a 48 bit image of the same resolution would be massive
do we really need THAT greater colour definition at the expense of video ram for our chimp eyes?
so a 24bit screen no matter how many colours on screen would be big
a 48 bit image of the same resolution would be massive
do we really need THAT greater colour definition at the expense of video ram for our chimp eyes?
I think 65536 is also a prime number ?
No, it's divisible by 8, not surprisingly.
and 2 4 16 etc ;)
speaking of prime numbers
i searched for prime numbers as large as lottery numbers (12 digits 11 if you start with (0)1 6 balls)
didnt find any lists going that high (perhaps i should have googled 12 digit prime numbers and not just prime numbers)
my quest was to only get lottery tickets that were 11/12 digits long prime numbers and see what would happen (and also how many their were)
might wiki it cos their might be some psudo code to get the maths of finding em out when they get a bit too large
speaking of prime numbers
i searched for prime numbers as large as lottery numbers (12 digits 11 if you start with (0)1 6 balls)
didnt find any lists going that high (perhaps i should have googled 12 digit prime numbers and not just prime numbers)
my quest was to only get lottery tickets that were 11/12 digits long prime numbers and see what would happen (and also how many their were)
might wiki it cos their might be some psudo code to get the maths of finding em out when they get a bit too large
I think 65536 is also a prime number ?
That's probably the daftest thing I've ever seen posted in a programming forum. big10p Your right it's not in "The Prime Pages" data base.
http://primes.utm.edu/
Maths was never my strongest points.
http://primes.utm.edu/
Maths was never my strongest points.
No kidding.
I think I learned at about 9 or 10 years old that for a number to be considered a prime number, it must first and foremost be an odd number.
A prime number, by definition is only equally divisible by 1, and by itself. Any even number is also equally divisible by 2.
I think I learned at about 9 or 10 years old that for a number to be considered a prime number, it must first and foremost be an odd number.
A prime number, by definition is only equally divisible by 1, and by itself. Any even number is also equally divisible by 2.
fekie bollocks ive just downloaded the all.txt from that site and its just like another one its 'formatted' into some colum malarky that just dont view at all
why the fek couldnt they just go
or better still have a section (like scrabble dictionarys) where they are listed by number of digits
so i could find all the 11 and 12 digit primes without all the bloody rest
why the fek couldnt they just go
1 3 5 7 etc
or better still have a section (like scrabble dictionarys) where they are listed by number of digits
so i could find all the 11 and 12 digit primes without all the bloody rest
Here is my visual representation (mainly for newbies):

for all those who like pictures and still are a little bit confused with binary numbers
Rectangles from 0 to 15 represents the bits of a 16-bit binary number.
These bits can be set to 1 or 0 (that's why we called them binary numbers). When all the bits are set to 1 then we get the largest 16-bit number and we can calculate what is the equivalent number in the decimal (human) system.
You can notice some subtotals such as 128, 256, etc. and you can understand why computers 'like' these numbers for for texture sizes, memory allocation chunk sizes etc.

for all those who like pictures and still are a little bit confused with binary numbers
Rectangles from 0 to 15 represents the bits of a 16-bit binary number.
These bits can be set to 1 or 0 (that's why we called them binary numbers). When all the bits are set to 1 then we get the largest 16-bit number and we can calculate what is the equivalent number in the decimal (human) system.
You can notice some subtotals such as 128, 256, etc. and you can understand why computers 'like' these numbers for for texture sizes, memory allocation chunk sizes etc.
I just ordered my new house and it has the production number #32762,
just 6 more customers ahead of me and it would have been a cool $8000 !!!
(..which BTW is exactly the half of 65536 !)
just 6 more customers ahead of me and it would have been a cool $8000 !!!
(..which BTW is exactly the half of 65536 !)
and hd tv's that boast way more colours than 24bits 16777216 ... come now can the human eye really tell the difference between $FFFFFF and $FFFFFE ???
With TV's boasting crazy figures like 10,000:1 contrast ratios (or more, OLED displays are 1,000,000:1!) then extending 256 shades of any colour between that kind of range could potentially give rise to visible banding. 16 bits per pixel solves that problem. 16 bits per pixel also means that when the TV does post-processing on the picture (even just altering brightness or contrast) it doesn't 'squash' the colour space so much that you could perceive it. Same methodology applies to sound samples. 32 bit sound samples can be processed, filtered, mixed etc without causing a loss in quality when they are exported to 16-bit files.
ok i could look it up but im not that bothered tbh ;)
i was going to make a 24bit to 12bit (amiga ham 4096) jpeg converter to see what the diference would be
but in uncompressed bmp im still using the same ammount of video ram so i thought 'why bother'
(mind you a pure white .bmp would be the same as a multi coloured picture so my initial argument was moot its the compression that matters)
12-bit total gives 4 bits per pixel, or 16 distinct shades for R, G and B. It's pretty obvious that you could tell the difference between each shade ;)
edit:
i have started making a .pal file for psp that has the first line of 16 as $000000 the next as $111111 etc all the way up to $FFFFFF (if pal files gave hex values it would be so much quicker now i have to find out what AA is in dec etc)
then im going to make a 'c64ish' 64 colour pallet too
might post some random pix with each option done
afaik all i have to do is split to rgb creating a grey scale
load in new pallet 3 times and merge and bobs your uncle a total waste of my time
Colour conversions can be quite complex, involving octrees and 4D transforms. Best not to bother ;)
well i KNEW going from 16.8 million colours to just 4096 would make SOME difference ;)
just toying with it as an idea for photo's
i never had my own images as ham files so im just curious how an amiga image might have looked
ive taken a colour picture and just had black and white and overlaid it back onto the original
that works nicely on some pics but its hit and miss
i avoided digital cameras till i could afford a decent mega pixel with SLR types of zoomage but im glad i did
i could have been running with something akin to a mobile phone camera years ago but i knew id get better results from film using a film scanner or straight to CD from the processors
just toying with it as an idea for photo's
i never had my own images as ham files so im just curious how an amiga image might have looked
ive taken a colour picture and just had black and white and overlaid it back onto the original
that works nicely on some pics but its hit and miss
i avoided digital cameras till i could afford a decent mega pixel with SLR types of zoomage but im glad i did
i could have been running with something akin to a mobile phone camera years ago but i knew id get better results from film using a film scanner or straight to CD from the processors
There's a little bit more to Hold And Modify than a straight 4096 colours. I don't know the ins and outs, but the colour of each pixel is calculated from a value assigned to it in combination with the values of surrounding pixels, which gave you small colour ramps between highly contrasting pixels.
1 3 5 7 etc
1 isn't prime, and 2 is..