It is currently Mon Dec 17, 2018 11:13 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Floating point recursion - Is this a bug?
PostPosted: Tue Apr 18, 2006 2:05 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
Run the code to see what I mean. Is this a bug?

Code:
Global Zf.f = 1
Global Z.l = 1

Procedure.f Testf(Valf.f)
  If Valf > 0
    Debug Valf
    ProcedureReturn Zf*Testf(Valf-1)
  EndIf
EndProcedure
Procedure.l Test(Val.l)
  If Val > 0
    Debug Val
    ProcedureReturn Z*Test(Val-1)
  EndIf
EndProcedure

Debug "FLOAT VERSION:"
Debug Testf(100)

Debug ""
Debug "LONG VERSION:"
Debug Test(100)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 18, 2006 2:38 pm 
Offline
Moderator
Moderator

Joined: Sat Dec 27, 2003 3:55 am
Posts: 3321
Location: Great Southern Land
It looks like a bug to me.

(It doesn't like the expression in the ProcedureReturn for some reason, remove the Zf* and it works).

_________________
@}--`--,-- A rose by any other name ..


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 18, 2006 3:18 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
"Some reason" is that the floating point stack/registers are not preserved on procedure calls and there are only 8 of them so in a 10 times recursive calling procedure like that all of them are filled up.

Edit: It's the same as this:
Code:
Test.f = 1
a.f = Test*(Test*(Test*(Test*(Test*(Test*(Test*(Test*(Test*Test))))))))
Debug a


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 18, 2006 3:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Jan 24, 2004 6:56 pm
Posts: 768
testing with PB4b10, only the recursion with the float value failed.

[edit]: Trond beat me to it... / I think the webmaster should move this to 'Bug Reports' as it really appears to be one.

_________________
cheers,
dell_jockey
________
http://blog.forex-trading-ideas.com


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Apr 18, 2006 4:00 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Jul 22, 2003 5:02 pm
Posts: 1534
Location: In a long distant galaxy
Old bug, same in PB3.94.

_________________
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 20, 2006 4:59 pm 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
Can we get a comment on this?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Apr 20, 2006 5:04 pm 
Online
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13439
Location: France
Yes, it's bug when you are running out of float registers, i will take a look.


Top
 Profile  
Reply with quote  
 Post subject: Re:
PostPosted: Sun Aug 01, 2010 11:58 pm 
Offline
New User
New User

Joined: Thu Nov 27, 2008 7:09 pm
Posts: 5
Fred wrote:
i will take a look.


Nothing happened, Bug is still bugging around.. :?
Tested today with 4.50 RC 2


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Mon Aug 02, 2010 12:03 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 7986
Location: Fort Nelson, BC, Canada
Quote:
Tested today with 4.50 RC 2

That's the second time in the last few days someone referenced RC2. There's no such thing yet!

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Mon Aug 02, 2010 12:19 am 
Offline
New User
New User

Joined: Thu Nov 27, 2008 7:09 pm
Posts: 5
The titlebar and aboutbox says "PureBasic 4.50 RC 2 (x86)".

However, it was the "Download PureBasic 4.50 full version for Windows"-Link.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Mon Aug 02, 2010 12:29 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 7986
Location: Fort Nelson, BC, Canada
Ok, I didn't notice the 4.50. It's 4.51 that's still at RC1. Mystery solved :mrgreen:

_________________
Veni, vidi, vici.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Mon Aug 02, 2010 12:47 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Feb 14, 2006 9:27 pm
Posts: 372
Location: London, UK
netmaestro wrote:
Quote:
Tested today with 4.50 RC 2

That's the second time in the last few days someone referenced RC2. There's no such thing yet!


Must be a secret build we don't know of :shock:

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Mon Aug 02, 2010 10:33 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 293
Location: Germany, Homburg (Saar)
The Bug is still here. When it will be fixed?

_________________
Electronics, Crazy & Interesting Stuff, all that with text, image and sound? Click here!

The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Tue Jan 29, 2013 4:50 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 22, 2003 7:43 pm
Posts: 293
Location: Germany, Homburg (Saar)
Now this bug looks strange. On my system the debugger gives this output:
Code:
FLOAT VERSION:
20.0
19.0
18.0
17.0
16.0
15.0
14.0
13.0
NaN

LONG VERSION:
20
19
18
17
16
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0

_________________
Electronics, Crazy & Interesting Stuff, all that with text, image and sound? Click here!

The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.


Top
 Profile  
Reply with quote  
 Post subject: Re: Floating point recursion - Is this a bug?
PostPosted: Tue Jan 29, 2013 10:39 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Jun 11, 2006 12:07 am
Posts: 421
Location: Germany / one of the fishheads
Same output here.
Windows XP SP3, 32 Bit, PB 5.10b5

_________________
Excuse my bad english, my nativ language is german.
PB 5.62, OS: Windows 7 Pro x64, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520
"Happiness is a pet." | "Never run a changing system!"
My current age: 50 years


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


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