comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: random integers between 0 and 1,000,000
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: random integers between 0 and 1,000,000 [message #45966 is a reply to message #45961] Mon, 24 October 2005 01:59 Go to previous messageGo to previous message
Norbert Hahn is currently offline  Norbert Hahn
Messages: 46
Registered: May 2003
Member
"Peter Albert" <peter.albert@gmx.de> wrote:

> Hi Mike,
>
> I'd guess you got the negative numbers because you defined the array

Unfortunately your guess does not correspond to the docu:

> weights beforehand to be of integer type. Assigning it with values of
> type long will lead to negative numbers if the values are larger than
> 2^15-1.

fix uses 15+1 bits for integer numbers (one bit is used for sign)
long uses 31+1 bits for integer numbers ...
ulong uses 32 bits for unsigned numbers. There is no sign.
long64...

So the original problem comes from interpreting the internal bits of
unsigned numbers. The preferable function for transforming 0...1 float
to integer without sign would be long.

Norbert
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Problem: Opening a 20-30MB sized ShapeFile
Next Topic: Keeping Button Pressed In?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 08:56:27 PDT 2025

Total time taken to generate the page: 0.00644 seconds