Overflow error in for loop

Overflow error in for loop - Messages

#1 Posted: 8/30/2009 1:52:43 AM
Greg Locock

Greg Locock

0 likes in 53 posts.

Group: User

Using the factorial for loop example

I ran the for loop example, eg with the counter set to 173
a:=1
for i:1,i<173,i:=i+1
a:=a*i

a=


which gives a remarkably small answer without an error message


This software has great potential by the way, thank you.
#2 Posted: 8/30/2009 10:39:14 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

I think you are right. I also suppose it is a bug!
[LIVE width=457 height=408]http://smath.info/live/?file=604[/LIVE]
Try yourself, please
[MATH]173!=#[/MATH]
or
[MATH]173!—#[/MATH]
The error has been issued this time - overflow!.

Regards,
Radovan

When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 8/30/2009 11:02:56 AM
Greg Locock

Greg Locock

0 likes in 53 posts.

Group: User

Oh, sure I have no problem with the factorial function overflowing, what I didn't like was the absence of an error message in the little program. You have incidentally answered another puzzle, how to use the "for" keybutton. Cheers greg
#4 Posted: 8/30/2009 11:16:21 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Wrote

Oh, sure I have no problem with the factorial function overflowing, what I didn't like was the absence of an error message in the little program.


A agree with you. Andrey will answer on this, for sure. Btw., I think he is rather busy at the moment. In a day or two a new release should be here.
Wrote

You have incidentally answered another puzzle, how to use the "for" keybutton.


You are welcome. Some things could be a problem at the beginning because there is no Help or Tutorial yet.
Btw., I hope you understood these two ways of "for" loop? The second one is obtained with "range" function. If not, let me know and I will give you a detailed explanation.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Posted: 8/30/2009 12:04:16 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Fixed. Thank you.

#6 Posted: 8/30/2009 12:46:27 PM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Thank you
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#7 Posted: 8/30/2009 6:19:10 PM
Andrey Ivashov

Andrey Ivashov

2270 likes in 3734 posts.

Group: Super Administrator

Finally, in order to avoid possible errors in the calculations below I've decided to forbid using variable, that caused an error.


Release will be available tomorrow in the midnight (01.09.2009).
  • New Posts New Posts
  • No New Posts No New Posts