RE: [bascom] Is "Single" can display "16777217" ?


From "Mark Alberts" <mark@mcselec.com>
Date Tue, 19 Jun 2001 00:13:52 +0200

Hi,

I only tried the value you provided. 16777216 and increased it with 1. That
worked too.
But indeed the single does not allow to store any number. There is a good
explanation available from microsoft.  I will look it up and post it here.

For the values you are using the best way is to use the LONG. But you know
that already I can imagine.

Best regards,
Mark Alberts


> -----Original Message-----
> From: owner-bascom@grote.net [mailto:owner-bascom@grote.net]On
> Behalf Of lancekao
> Sent: woensdag 13 juni 2001 6:47
> To: bascom@grote.net
> Subject: [bascom] Is "Single" can display "16777217" ?
>
>
>
> hi Mark
>   is single can display " 16777217"?
>   I had been spand one day to find out the answer
>   in "Single" mode
>
>   Decimal    Hex
>   16777212 = 4B 7F FF FC
>   16777213 = 4B 7F FF FD
>   16777214 = 4B 7F FF FE
>   16777215 = 4B 7F FF FF
>   16777216 = 4B 80 00 00
>   16777218 = 4B 80 00 01
>   16777220 = 4B 80 00 02
>   16777222 = 4B 80 00 03
>   :
>   :
>   I think "Single" Can't Display "16777217","16777219",...
>
>   this isn't the bug of compiler
>   this is the limit of "Single"
>
>   if the program change X+2 it will be O.K.
>
>
>  $crystal = 7372800
>  Dim X As Single
>  X = 16777200
>  Do
>    X = X + 2    'Incr X
>    Print X
>    Wait 1
>  Loop
>
> Best regards,
>
> Lance Kao
>
>
> :Hi,
>
> ;I checked it but works ok.
> ; 16777216 will be  16777217.0 after the print.
>
> ;You can store huge numbers in a single and  16777216 will fit fine.
>
> ;Best regards,
> ;Mark Alberts
>
> > -----Original Message-----
> > From: owner-bascom@grote.net [mailto:owner-bascom@grote.net]On
> > Behalf Of lancekao
> > Sent: vrijdag 8 juni 2001 11:03
> > To: bascom@grote.net
> > Subject: [bascom] 1.11.6.2 Bug Reprot for using Single
> >
> >
> >
> > hi this is my first report for the bug of using the Single
> >
> > I am using the 8515 chip and the program as below
> > when I run the program
> > the X output only can reach the " 16777216 " = &H 1000000
> > the value can't bigger then 16777216
> > this is the limit for the "Single" or this is the bug for the BASCOM
> >
> > Lance Kao
> >
> > $crystal = 7372800
> > Dim X As Single
> >
> > X = 16777200
> >
> > Do
> >
> >   Incr X
> >
> >   Print X
> >
> >   Wait 1
> >
> > Loop
>
> ==================================================================
> 新浪網.免費 50MB 電子信箱  http://www.sinamail.com
>
>
>