More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 25, 14:07:15

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  TS2: Burnination
| |-+  The Podium
| | |-+  Primitive 0x2, int32, and overflow
0 Members and 1 Chinese Bot are viewing this topic. « previous next »
Pages: [1] THANKS THIS IS GREAT Print
Author Topic: Primitive 0x2, int32, and overflow  (Read 3352 times)
rufio
Non-Standard
Uncouth Undesirable
****
Posts: 3030


More Nonstandard Than You


View Profile WWW
Primitive 0x2, int32, and overflow
« on: 2010 January 25, 20:23:33 »
THANKS THIS IS GREAT

I am guessing that the expression primitive does signed 16-bit math, correct?  Is there any way to coerce it into doing 32-bit math, or unsigned math, or getting it to check for overflow?  Or would I have to implement that myself if I wanted it?
Logged

I was thinking about these things and I am a feminist.

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Primitive 0x2, int32, and overflow
« Reply #1 on: 2010 January 26, 06:07:28 »
THANKS THIS IS GREAT

I am guessing that the expression primitive does signed 16-bit math, correct?  Is there any way to coerce it into doing 32-bit math, or unsigned math, or getting it to check for overflow?
Nope.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
Inge
Round Mound of Gray Fatness
Senator
*
Posts: 4320


Senator Emeritus. Oh hold on, I am still a senator


View Profile WWW
Re: Primitive 0x2, int32, and overflow
« Reply #2 on: 2010 January 26, 16:20:46 »
THANKS THIS IS GREAT

EA make liberal use of mod and div and store values in multiple variables, one for units, one for tens of thousands etc Smiley 
Logged


\"They\'re here, on the forum. A question riddled, spoiler giving, speculative cancer of sim evil\" -- redearth, Snooty Sims, 2009
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: Primitive 0x2, int32, and overflow
« Reply #3 on: 2010 January 26, 18:12:17 »
THANKS THIS IS GREAT

That method is only used to store money and not really for anything else, and represents more of a special, handmade behavior than true 32-bit math.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
rufio
Non-Standard
Uncouth Undesirable
****
Posts: 3030


More Nonstandard Than You


View Profile WWW
Re: Primitive 0x2, int32, and overflow
« Reply #4 on: 2010 January 26, 18:42:06 »
THANKS THIS IS GREAT

Yes, I was actually looking at the earned money value when I asked this - if you use the Date Counter thingy from Darcyland to track wealth, you can see that there appears to be some kind of horrible overflow problem with it, so that my sim has apparently made "92 thousand, -3029 simoleans".  It obviously doesn't affect things badly enough that sims can't still make $100K in a reasonable amount of time, but it's extremely annoying when I'm trying to keep track as I go along.  I don't know why they didn't simply use (or simulate) 32-bit ints there - it would have made much more sense and probably would have been easier to debug.
Logged

I was thinking about these things and I am a feminist.

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.066 seconds with 20 queries.