Computing problem
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Ferdinand.
Hi everyone,
Trying out PureBasic and I've got the following computing problem:
another basic language says it can run (it's version of) the following program in 0.84 seconds:
x.f = 1
y.f = 1.000001
i.l
For i = 1 To 100000000
x = x * y
Next i
MessageRequester("FerTest02", StrF(x), 0)
End
So I tried this in PureBasic for comparison, but it gives as a result for "x": "1.#INF". PureBasic doesn't seem to have double precision floats; is there a workaround for this ?
Hi everyone,
Trying out PureBasic and I've got the following computing problem:
another basic language says it can run (it's version of) the following program in 0.84 seconds:
x.f = 1
y.f = 1.000001
i.l
For i = 1 To 100000000
x = x * y
Next i
MessageRequester("FerTest02", StrF(x), 0)
End
So I tried this in PureBasic for comparison, but it gives as a result for "x": "1.#INF". PureBasic doesn't seem to have double precision floats; is there a workaround for this ?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fweil.
Ferdinand,
Welcome to the PureBasic forum first.
We have actually a limitation using float numbers.
This should be released in a future version. Look posts on the forum and updates on the Home Page to keep informed.
Rgrds
Francois Weil
14, rue Douer
F64100 Bayonne
Ferdinand,
Welcome to the PureBasic forum first.
We have actually a limitation using float numbers.
This should be released in a future version. Look posts on the forum and updates on the Home Page to keep informed.
Rgrds
Francois Weil
14, rue Douer
F64100 Bayonne
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Ferdinand.
Hi Francois,
thanks for your reply, I'll keep an eye on the PureBasic updates !
I made a long-integer version of the benchmark program:
x.l = 1
y.l = 1
s.s = FormatDate("%hh:%mm:%ss", Date())
MessageRequester("FerTest 1", s, 0)
For i = 1 To 100000000
x = x + y
Next i
a.s = StrF(x)
s = FormatDate("%hh:%mm:%ss", Date())
MessageRequester("FerTest: "+Str(x), s, 0)
End
PureBasic flies through these 100 millon (!) iterations in 1 (!) second (on my 1.6 Ghz XP). Phew.
Hi Francois,
thanks for your reply, I'll keep an eye on the PureBasic updates !
I made a long-integer version of the benchmark program:
x.l = 1
y.l = 1
s.s = FormatDate("%hh:%mm:%ss", Date())
MessageRequester("FerTest 1", s, 0)
For i = 1 To 100000000
x = x + y
Next i
a.s = StrF(x)
s = FormatDate("%hh:%mm:%ss", Date())
MessageRequester("FerTest: "+Str(x), s, 0)
End
PureBasic flies through these 100 millon (!) iterations in 1 (!) second (on my 1.6 Ghz XP). Phew.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fweil.
Ferdinand,
I suppose it was not made so much public benchmarks but we had a nice internal 'contest' by trying to parse large files and count lines and words.
We all know that PureBasic runs fast as it is so close to low level assembly when compiling. Simple integers processing is really impressive.
Check what we have got as results on this parsing program contest at : viewtopic.php?t=2450">http://forums.pur ... ns.com/pb/
We have also localized forums in german http://www.pure-board.de and french http://www.serveurperso.com/~cederavic/forum/ now to give a chance to the maximum of people to participate in discussions.
Enjoy PureBasic and continue to post examples.
Francois Weil
14, rue Douer
F64100 Bayonne
Ferdinand,
I suppose it was not made so much public benchmarks but we had a nice internal 'contest' by trying to parse large files and count lines and words.
We all know that PureBasic runs fast as it is so close to low level assembly when compiling. Simple integers processing is really impressive.
Check what we have got as results on this parsing program contest at : viewtopic.php?t=2450">http://forums.pur ... ns.com/pb/
We have also localized forums in german http://www.pure-board.de and french http://www.serveurperso.com/~cederavic/forum/ now to give a chance to the maximum of people to participate in discussions.
Enjoy PureBasic and continue to post examples.
Francois Weil
14, rue Douer
F64100 Bayonne
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
Try the difference:
1.)
2.)
3.)
4.)
You should see some differences in time...
cya,
...Danilo
(registered PureBasic user)
Try the difference:
1.)
Code: Select all
y = 1oldTime = GetTickCount_()
For i = 1 To 100000000
x + y
Next i
newTime = GetTickCount_()
ms = newTime-oldTime
MessageRequester("Result: "+StrU(x,2),StrU(ms,2)+" milliseconds"+Chr(10)+"("+StrF(ms/1000,2)+" seconds)",0)Code: Select all
oldTime = GetTickCount_()
For i = 1 To 100000000
x + 1
Next i
newTime = GetTickCount_()
ms = newTime-oldTime
MessageRequester("Result: "+StrU(x,2),StrU(ms,2)+" milliseconds"+Chr(10)+"("+StrF(ms/1000,2)+" seconds)",0)Code: Select all
oldTime = GetTickCount_()
For i = 1 To 100000000
!INC dword [v_x]
Next i
newTime = GetTickCount_()
ms = newTime-oldTime
MessageRequester("Result: "+StrU(x,2),StrU(ms,2)+" milliseconds"+Chr(10)+"("+StrF(ms/1000,2)+" seconds)",0)Code: Select all
oldTime = GetTickCount_()
While x < 100000000
x + 1
Wend
newTime = GetTickCount_()
ms = newTime-oldTime
MessageRequester("Result: "+StrU(x,2),StrU(ms,2)+" milliseconds"+Chr(10)+"("+StrF(ms/1000,2)+" seconds)",0)You should see some differences in time...
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Ferdinand.
I'm deeply impressed.
Program type 1 : 422 milliseconds
Program type 2 : 407 milliseconds
Program type 3 : 375 milliseconds
Program type 4 : 531 milliseconds
Program type 3 is assembler coding ? Maybe difficult to learn...
Anyway, being able to use just the other types is fine by me
I'm deeply impressed.
Program type 1 : 422 milliseconds
Program type 2 : 407 milliseconds
Program type 3 : 375 milliseconds
Program type 4 : 531 milliseconds
Program type 3 is assembler coding ? Maybe difficult to learn...
Anyway, being able to use just the other types is fine by me
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Fangbeast.
:)
Fangles woz ear orright den?
I'd never buy IntelOriginally posted by Danilo
For me, the order is 1..2..3..4 (4 is fastest).
Looks like you are using AMD processors...
i´m using iNTEL only (never would buy AMD).
So you see, there is also a difference in processors.
cya,
...Danilo
(registered PureBasic user)
Fangles woz ear orright den?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by TheBeck.
@Danilo
> cheap bastard
First of all I want to scream, pull my hair out and grab my blow torch and do some flaming. However I have left my childhood and I think I can come up with a mature response. I will just have you know it's taking a little effort. No hard feelings toward you of course, you were just expressing your opinion and probably were joking anyway.
Choosing AMD is not about being cheep it is about value and choice and innovation. Do you think Intel would be selling it's processors for as little as they are if it weren't for the extreme competition from AMD? Of course not. Do you think Intel would have a 3GHZ Pentium 4 on the market if it weren't for the extreme competition from AMD? Of course not. Surely you remember the days when Intel's top of the line processors went for over five hundred dollars. The truth is if it weren't for AMD, Intel wouldn't even have the Celeron on the market. AMD is the only company that has ever had both the courage and the talent to compete with Intel. If it were not for AMD PCs would still cost $2000 for the low end models, the fastest processor you would be able to get would be a 2GHZ Pentium 4 and you would be paying $500-$1000 just for the CPU. So I say thank God for AMD.
- Nathan Beckstrand, AMD customer for life.
PS: sorry for the long post but as you can see I am VERRY passionate on this subject. And I am not full of Sh*t either, if you think about the past when Intel had NO competition, then you know what I say is true.
@Danilo
> cheap bastard
First of all I want to scream, pull my hair out and grab my blow torch and do some flaming. However I have left my childhood and I think I can come up with a mature response. I will just have you know it's taking a little effort. No hard feelings toward you of course, you were just expressing your opinion and probably were joking anyway.
Choosing AMD is not about being cheep it is about value and choice and innovation. Do you think Intel would be selling it's processors for as little as they are if it weren't for the extreme competition from AMD? Of course not. Do you think Intel would have a 3GHZ Pentium 4 on the market if it weren't for the extreme competition from AMD? Of course not. Surely you remember the days when Intel's top of the line processors went for over five hundred dollars. The truth is if it weren't for AMD, Intel wouldn't even have the Celeron on the market. AMD is the only company that has ever had both the courage and the talent to compete with Intel. If it were not for AMD PCs would still cost $2000 for the low end models, the fastest processor you would be able to get would be a 2GHZ Pentium 4 and you would be paying $500-$1000 just for the CPU. So I say thank God for AMD.
- Nathan Beckstrand, AMD customer for life.
PS: sorry for the long post but as you can see I am VERRY passionate on this subject. And I am not full of Sh*t either, if you think about the past when Intel had NO competition, then you know what I say is true.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
@TheBeck:
I know, and dont have a problem with it.
You buy AMD only - i buy iNTEL only...
without this, competition between them
would not exist.
All my friends support AMD, because they
look at the money only.
I want to support iNTEL, because they
supported me.
cya,
...Danilo
(registered PureBasic user)
@TheBeck:
I know, and dont have a problem with it.
You buy AMD only - i buy iNTEL only...
without this, competition between them
would not exist.
All my friends support AMD, because they
look at the money only.
I want to support iNTEL, because they
supported me.
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Ferdinand.
Danilo,
that's odd ! According to all my info Compu's got an Intel 1,6 Ghz inside of it. What's yours ? Have you checked it ? Maybe the store made a mistake ?
Ferdinand.
btw. on first sight inline-assembly would be the fastest (program type 3) as compared to all the code made from "higher-level" statements.
Danilo,
that's odd ! According to all my info Compu's got an Intel 1,6 Ghz inside of it. What's yours ? Have you checked it ? Maybe the store made a mistake ?
Ferdinand.
btw. on first sight inline-assembly would be the fastest (program type 3) as compared to all the code made from "higher-level" statements.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm