[Implemented] Word is signed

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

[Implemented] Word is signed

Post by Edwin Knoppert »

Help shows Integer aspects for Word.
I want to have a word variable (65000 etc..)

In this case help should mention integer, not word.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

All variables are signed? Where is the problem.

btw:

Code: Select all

w.w=-1
l.l=w % $ffff
debug l
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Re: Word is signed

Post by tinman »

Edwin Knoppert wrote:Help shows Integer aspects for Word.
I want to have a word variable (65000 etc..)

In this case help should mention integer, not word.
Which would only help to confuse the issue since in the language they are words, not integers. Unless you propose that .w be changed to .i?

Word (in all the times I've seen it) reflects only the size of the variable, usually 16 bits. Whether it is signed or unsigned is up to the compiler/application.

Shouldn't this be in the feature requests section anyway? Loads of people have asked for unsigned versions of all the built in types.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

??? confused mode = true

Of course it matters.
image i used a word for looping from 0 to 64000 ?

Main issue to me is that w (which behaves as signed integer) should accept w.w = 64000 for example.
I did not test this.
But that's confusing isn't?

PB should make it an integer w.i or so and w.w for word.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Help shows Integer aspects for Word.
I want to have a word variable (65000 etc..)
In this case help should mention integer, not word.
Hmmm, I beg to differ here, as I have always though and read, the term integer means any of the natural numbers, the negatives of these numbers, or zero.
Wikipedia wrote:The integers consist of the natural numbers (0, 1, 2, ...) and their negatives (-0, -1, -2, ...; -0 is equal to 0 and therefore not included as a separate integer).
The term Word as it refers to computer systems is the range of these integers.
Wikipedia wrote: The term word initially was equivalent to ‘the logical size of an address of a location in the system memory’, and was thus CPU- and OS-specific. One could say that the IBM System/360 had 32-bit words (even though its addresses were limited to 24 bits), and the 8086 had 16-bit words.
I think maybe the term 'integer' has been confused with the term 'unsigned word'. :?:

http://en.wikipedia.org/wiki/Integer_%2 ... science%29
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Edwin Knoppert wrote: Of course it matters.
not :D
image i used a word for looping from 0 to 64000 ?
You wouldn't want to do so, as it's slower than looping using a Long ;-)
Post Reply