www.ClassicTW.com
http://www.classictw.com/

For curiosity more than anything...
http://www.classictw.com/viewtopic.php?f=13&t=31625
Page 1 of 1

Author:  HiTechRedneck [ Mon May 30, 2011 11:34 pm ]
Post subject:  For curiosity more than anything...

I had a random thought earlier, as I often do, that popped into my head from out of nowhere... I wasn't even playing at the time, I was out mowing my yard... I'm sure JP could tell me based on the program, but does anybody know the limit to the amount of cash you can store in a cit?

Author:  Comet [ Tue May 31, 2011 12:13 am ]
Post subject:  Re: For curiosity more than anything...

5 999's yeah what sing said

Author:  Singularity [ Tue May 31, 2011 12:24 am ]
Post subject:  Re: For curiosity more than anything...

In a cit? According to t-edit...
999,999,999,999,999

That's 5 999's.

Author:  HiTechRedneck [ Tue May 31, 2011 2:47 am ]
Post subject:  Re: For curiosity more than anything...

Interesting, since that is not a flat programming number... Thanks for the info Sing...

Author:  Singularity [ Tue May 31, 2011 3:22 am ]
Post subject:  Re: For curiosity more than anything...

Right, it's larger than a 32bit int, yet it's not a float. Probably 64bit, just trimmed down. Wonder how someone would implement a 64bit int in Pascal like that. That can't be a native data type.

Author:  Trivius [ Thu Jun 02, 2011 5:09 am ]
Post subject:  Re: For curiosity more than anything...

Also for consideration there are:

1. ‘Int64’ [-/+9.223-quintillion] or ‘Qword’ [0 to 18.446-quintillion] (which are not compatible with all constructs).
-- or --
2. Variables declared as ‘Integer’ (unset bit lengths are 255).

Author:  John Pritchett [ Thu Jun 02, 2011 12:40 pm ]
Post subject:  Re: For curiosity more than anything...

I just came across this while moderating posts. Sorry I didn't see it earlier. I can give you more details on that.

The citadel treasury field is a Double, which is a 64 bit float. Double was native to the Turbo Pascal compiler Gary was using back in those days. It's a 15 significant digit float and TW only uses the whole number, not the decimal.

After I converted to Delphi 4, a 64 bit integer type was available as a native field type, but I didn't make any change to the use of Double for large numbers. I only recently started using Int64 with this latest release, mostly because all of the new internal timing uses performance counters which return 64 bit integer milliseconds. You can only store about 49 days worth of milliseconds in a dword, but int64 gives you plenty of room. So no game logic currently uses int64, but all of the clock and timing code does.

Author:  Singularity [ Thu Jun 02, 2011 2:43 pm ]
Post subject:  Re: For curiosity more than anything...

Nice. I didn't remember Pascal having that.

Author:  Scrat [ Fri Jun 03, 2011 2:12 pm ]
Post subject:  Re: For curiosity more than anything...

A floating number! That explains why you can take all the cash out of a treasury and come back some days later to find 1 credit. It's still compounding the change.

Author:  John Pritchett [ Sat Jun 04, 2011 5:33 pm ]
Post subject:  Re: For curiosity more than anything...

I guess that would be a bug ;)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/