65,535

morninggirl5 said:
don't keep us in suspence...... explain

One hint for you nice lady. I'll let Guru decide when to elaborate.

It's because computers think 65535 + 1 = 0 and the BB programmer doesn't think starting over would look right.
 
Guru said:
The largest number that can be represented with 16 binary bits is 65,535. So why didn't the programmer use 32 bits?

Tony, I didn't know you were a computer guy... You are multi-talented.

Probably because counters are habitually ddefined as "word" values. I suspect the programer never figured on needing a "Long Integer" data type for a view counter on BB thread. 100 replies is very long thread, and 1000 views is a "very interesting" thread.

For those non-programmer types:

Computer programs use several different types of numbers because computer operations are faster with smaller amounts of information. The prrogrammer in this case chose a "Word" number type, meaning an unsigned integer (Whole Number from 0 to 65535) because using a "Dword" or "Long Integer" because 32 bit integers take over twice as long to add one to than 16 bit integers require.

"Real Number" values (decimals) can take as much as TEN times as long to add one to.

Programmers have to make a "best guess" about what the biggest number will ever be needed for any given information. We sseem to haave proved this programer wrong. :p
 
Now my question is, how would they program for a Non-real number? What about pi?

I'm completely non-computer knowledgeable, but I love Math.
 
yeah, I figured the fractional part out....

explain the others .... and what about negative numbers

especially with accounting packages you're dealing with a lot of negatives
 
morninggirl5 said:
yeah, I figured the fractional part out....

explain the others .... and what about negative numbers

especially with accounting packages you're dealing with a lot of negatives

There are several ways of programming accounting packages depending on what they're needed for. A Household accounting pckage can be done with Long Integers to get a range of -$21,474,836.48 to +$21,474,836.47. Or with "Dword" values of $42949672.96 using an extra indicator stored separately to indicate the sign of the value.

The values stored are actually 100 times the values indicated, with the decimal point added in the display process.

"real" number data types are stored in a form exponential notation with twelve significant digits.

Imaginary Numbers are stored and manipulated the same as real numbers with a boolean indicator associated with it by the program for is/is not imaginary.

Computers have inherent problems dealing with a "divide by Zero" opertion, and operations that would result in imaginary numbers. Programmers have to check carefully for vaalues that would produce them, and program a way to work around computers' limitions.

The basic number data types are:

Byte: An eight place binary number valued from 0 to 256. Negative values can be programed by adding 128 and defining 128 as meaning zero, 129 as -1, 130 as -2, etc up to 255 means -127.

Word: a 16 bit unsigned integer. 0 to 65535

Integer: a 16 bit signed value. -32768 to +32767.

DWord: A double word valued at 0 to (2^32)-1

Long Integer: A signed version of a DWord valued at -2^31 to (2^31)-1

Real: Unfortunately I don't have the exaact defintion handy, but it is essentially as decribed above. I never bothered to memorize the range of "Real" numbers becuse the processing time is so much higher than for the whole number data types. They're probably used more in programs written specifically for modern computers, but when I was aactively programing, processor time was an important consideration. It still is in terms of relative processing times.

Doing a math problem with integer data types will always run faster than exactly the same problem done with the 'Real' data type. If you're mashing numbers in enough quantity that the processing time is noticeble, it will be ten times as noticeable with real numbers.
 
That all made sense.... (And gave me a great idea for teaching place value, thanks)

And how do you deal with pi?
 
OWIE!!!!!!!

Geez...I should never have read this thread...now my head hurts!!

Dreamweaver leaves holding head and moaning...where's the darn aspirin....I feel a migraine coming on!
 
Back
Top