It is currently Sat Dec 15, 2018 10:03 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Pow mistake PB 5.10/b11-64 - win7/8-64
PostPosted: Sat Mar 16, 2013 7:40 pm 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 931
Hi,
please test it :

Fail with PB 5.10 64bit / win 7/8

restart multiple and it works sometimes !

Code:
free.q=Pow(10,8)

If free.q<Pow(10,7)
  Debug"xxx"
EndIf


Werner

_________________
http://www.nachtoptik.de


Last edited by walbus on Sat Mar 16, 2013 9:11 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Pow mistake PB 64bit - win8
PostPosted: Sat Mar 16, 2013 8:26 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Mar 24, 2011 12:40 am
Posts: 523
Location: Iowa, USA
tested with Win 7, 64 bit.
PB 5.10 (X64)

confirmed something strange is happening here.
first run this code, it will fail.
Code:
Q1.q = Pow(10, 8)
Q2.q = Pow(10, 7)

If Q1 < Pow(10, 7)
   Debug "fail"
Else
   Debug "OK"
EndIf

Then change code to this and run, it will be OK.
Code:
Q1.q = Pow(10, 8)
Q2.q = Pow(10, 7)

If Q1 < Q2
   Debug "fail"
Else
   Debug "OK"
EndIf

Then run the first code again and it will be OK.
After closing the PureBasic IDE and restarting, the first code will fail again.

BP

_________________
BasicallyPure
Until you know everything you know nothing, all you have is what you believe.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pow mistake PB 64bit - win8
PostPosted: Sat Mar 16, 2013 8:34 pm 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 931
but, with double, not quad, it works !

_________________
http://www.nachtoptik.de


Top
 Profile  
Reply with quote  
 Post subject: Re: Pow mistake PB 64bit - win8
PostPosted: Sat Mar 16, 2013 8:52 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Mar 21, 2006 12:31 am
Posts: 1773
Location: Canada
Same experiences with PureBasic 5.11 beta 3 (x64) on Windows 7 x64.

Original code fails, make the suggested change and it works. Undo change and it still works. Restart the PB compiler and it fails again.

So the topic should be updated. :p

_________________
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley


Top
 Profile  
Reply with quote  
 Post subject: Re: Pow mistake PB 64bit - win8
PostPosted: Sat Mar 16, 2013 9:03 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3268
Location: Netherlands
It seems to be a comparison bug.
When using
If Q1 < Pow(10, 7)
the jump condition in the ASM source is JE

When using
If Q1 < Q2
the condition is JGE

JE is a check for equality so that's probably why it fails.

_________________
macOS 10.14 Mojave, PB 5.62 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: Pow mistake PB 5.10/b11-64 - win7/8-64
PostPosted: Fri Jun 01, 2018 6:57 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Feb 04, 2013 5:28 pm
Posts: 332
Using PB 5.62 x64 this always work correctly for me now.

The original code and the code from BasicallyPure always work, I also tried restarting the IDE multiple times.

The comparison in the asm is done by using JGE and seems fine.

:?:


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye