Le 11/10/2014 06:58, T Lee Davidson a écrit : > 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? >
You're right, I thought that the number of occurrences was printed, not the result. Always look at the code before answering! :-) Well, as Fabien says, shows the Pascal code. I find strange that a compiled Pascal program is twice slower than an interpreted Gambas program. Or there is something weird in the Lazarus compiler? Regards, -- Benoît Minisini ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://p.sf.net/sfu/Zoho _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
