[Gambas-user] about IsFloat and IsInteger behaviour...

nando nando_f at ...1382...
Sun May 14 05:08:05 CEST 2006


I do believe CInt will convert to a 4 byte Integer.
I heavily use CByte to convert to a 1 byte.
I do this because
  Write #hfile, Byte_Var
will definitely write to a file only 1 byte.

Question for Benoit, 

Do you screen all emails to this forum or do they
all get posted automatically??

-Fernando


---------- Original Message -----------
From: Christopher Brian Jack <brian at ...1334...>
To: gambas-user at lists.sourceforge.net
Sent: Sat, 13 May 2006 17:58:03 -0700 (PDT)
Subject: Re: [Gambas-user] about IsFloat and IsInteger behaviour...

> On Sat, 13 May 2006, Benoit Minisini wrote:
> 
> Isn't there like a CInt() or something when you really need an
> integer-typed result?
> 
> > Date: Sat, 13 May 2006 20:18:46 +0200
> > From: Benoit Minisini <gambas at ...1...>
> > Reply-To: gambas-user at lists.sourceforge.net
> > To: gambas-user at lists.sourceforge.net
> > Subject: Re: [Gambas-user] about IsFloat and IsInteger behaviour...
> >
> > On Thursday 11 May 2006 15:45, Stefano Palmeri wrote:
> > > Hi all.
> > >
> > > It's a lot of time from my mathematics studies at school, so excuse the
> > > stupid question...
> > >
> > > Please, could someone explain to me this Gambas behaviour?
> > >
> > > ------------------------------
> > > PRINT IsFloat (Int(4 / 2))
> > > --> True ?
> > >
> > > PRINT IsFloat(2)
> > > --> False
> > > ------------------------------
> > >
> > > ------------------------------
> > > PRINT IsInteger(3.5)
> > > --> False
> > >
> > > PRINT IsInteger(Int(3.5))
> > > --> False ?
> > > ------------------------------
> > >
> > > Thanks in advance for any answer.
> > >
> > > Regards,
> > >
> > > Stefano Palmeri
> > >
> > > Gambas 1.0.14
> > > Gambas 1.9.28
> > >
> >
> > Because Int() is implemented as always returning a floating point number. The
> > IsXXX() functions test the Gambas datatype of an expression, not its real
> > type in the real life!
> >
> > Regards,
> >
> > --
> > Benoit Minisini
> >
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> 
> .=================================================.
> |  Christopher BRIAN Jack aka "Gau of the Veldt"  |
> +================================================='
> | brian _AT_ brians-anime _DOT_ com
> `=================================================-
> Hi Spambots, my email address is sputnik at ...1334...
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job 
> easier Download IBM WebSphere Application Server v.1.0.1 based on 
> Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
------- End of Original Message -------





More information about the User mailing list