[Gambas-user] Wow, Gambas is twice as fast as (Free) Pascal

T Lee Davidson t.lee.davidson at ...626...
Sat Oct 11 06:58:06 CEST 2014


On 10/10/2014 08:50 PM, Benoît Minisini wrote:

Thank you for trying to explain that to me. But, now I am really confused.

As far as I can tell, the Gambas program also uses floating point 
numbers. The only integers I see used in that program are for an 
iterator, an array index, and an iterator boundary. Everything else is 
declared as a Float.

~~~
Sub Test(X As Float) As Float

   Dim Mu As Float = 10.0
   Dim Pu, Su As Float
   Dim I, J, N As Integer
   Dim aPoly As New Float[100]

   N = 500000

   For I = 0 To N - 1
     For J = 0 To 99
       Mu =  (Mu + 2.0) / 2.0
       aPoly[J] = Mu
     Next
     Su = 0.0
     For J = 0 To 99
       Su = X * Su + aPoly[J]
     Next
     Pu += Su
   Next

   Return Pu

End

Dim I as Integer

For I = 1 To 10
   Print Test(0.2)
Next
~~~

What am I missing?




More information about the User mailing list