hpgcc2 loop problem
|
03-13-2021, 06:41 AM
(This post was last modified: 03-13-2021 06:42 AM by BINUBALL.)
Post: #1
|
|||
|
|||
hpgcc2 loop problem
I use HPGCC2 and this tutorial to make sum program for 50g.
http://sense.net/~egan/hpgcc/ example, This sum program made in UserRPL looks like this Code: << -> n so, I want to C's speed. I coded this. Code: #include <hpgcc49.h> Code: << "Input 1 real" -> n But I execute this program to calculate 1 to 1000 sum, It gives 499500 instead of 500500. and number goes up over 1000, It gives wrong answer. ex) input -> answer 999 -> 499,500 (correct) 1,000 -> 499,500 (incorrect which is 500,500) 1,001 -> 500,500 (incorrect which is 501,501) 2,000 -> 1,999,000 (incorrect which is 2,001,000) 10,000,000 -> -2,001,260,032 (I think it is overflow) I'm a very noob for C, so my code may be wrong. What's wrong with my program? S.Korean / HP-50G | fx-570EX | fx-570CW | HP-200LX |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
hpgcc2 loop problem - BINUBALL - 03-13-2021 06:41 AM
RE: hpgcc2 loop problem - brickviking - 03-15-2021, 10:14 AM
RE: hpgcc2 loop problem - toml_12953 - 03-15-2021, 10:22 AM
RE: hpgcc2 loop problem - BINUBALL - 03-15-2021, 11:18 AM
RE: hpgcc2 loop problem - Egan Ford - 03-15-2021, 05:55 PM
RE: hpgcc2 loop problem - BINUBALL - 03-16-2021, 12:42 AM
RE: hpgcc2 loop problem - BINUBALL - 03-16-2021, 03:34 AM
RE: hpgcc2 loop problem - Egan Ford - 03-18-2021, 05:01 PM
RE: hpgcc2 loop problem - Gjermund Skailand - 03-16-2021, 02:08 PM
RE: hpgcc2 loop problem - Claudio L. - 03-16-2021, 04:20 PM
RE: hpgcc2 loop problem - Egan Ford - 03-18-2021, 05:02 PM
RE: hpgcc2 loop problem - Claudio L. - 03-19-2021, 02:51 PM
RE: hpgcc2 loop problem - BINUBALL - 03-20-2021, 07:38 AM
RE: hpgcc2 loop problem - BINUBALL - 03-17-2021, 01:19 AM
|
User(s) browsing this thread: 1 Guest(s)