|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
hey, i am having a little bit of trouble when i call calc....for example, if i do this:
//echo -a $calc(5599395841418 - 500)
it echos this: 5599395840917.999616
when it should just return:
5599395840918
500 less then what it was, why am i getting 501 less then what it was, PLUS a dot and more numbers after it :|
i dont need the dot, and whatever is after it, all thats doing it causing problems for what i'm doing, any ideas?
|
|
|
|
Joined: Dec 2002
Posts: 774
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 774 |
Couldn't reproduce
|
|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
There was a post about this before, it was suggested the problem was linked to processor type, but I don't know if a definitive reason was ever found.
|
|
|
|
Joined: Dec 2002
Posts: 3,015
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,015 |
I have the same problem (Windows XP Home SP1, Athlon XP 1900+)
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
soooo, i am going to guess that there isnt a way to fix this little problem?
|
|
|
|
Joined: Dec 2002
Posts: 1,893
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,893 |
Tried /var %var = 5599395841418 - 500 ?
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
Does The Same Thing unfortunately
but i not doing anything with vars, so even if it did work, it wouldnt help me much, cause sure, i can set the variable to that, but then i still end up having to calc the var again later, which would end up returning the "samething"
perhaps a bug khaled will have to look at for the next version possibly?
|
|
|
|
Joined: Dec 2002
Posts: 103
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 103 |
The number you used is too big. Most languages allow integers of around 2^32, and some 2^64. Seeing how this is a windows 32bit program I'm guessing the largest number you should use is 2^32.
|
|
|
|
Joined: Dec 2002
Posts: 270
Fjord artisan
|
OP
Fjord artisan
Joined: Dec 2002
Posts: 270 |
might i ask what the heck 2^32 means?
and i cant really set the largest number, cause its part of a game, and it add their points bassed on what they win,,,,,know what i mean
|
|
|
|
Joined: Dec 2002
Posts: 2,884
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,884 |
^ is the exponent operator. 2^32 means 2 to the power of 32.
Pasmal: I don't think that's the problem though, the calculation works perfectly for me on a pentium3 (500mhz) with Win98SE and an Athlon XP2400+ with WinXP Home SP1. It's a rather bizarre problem but doesn't seem to be tied to anything system related - my 2nd system seems to be pretty close to Collective's, yet he gets the problem and I don't. Strange indeed.
|
|
|
|
Joined: Dec 2002
Posts: 103
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 103 |
hm I think you're right, I just tested on a p3 500 & a XP 1800, both worked fine.
|
|
|
|
Joined: Dec 2002
Posts: 9
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Dec 2002
Posts: 9 |
Calculated it is 4294967296  Your calculations gives no problems on my PI 233
|
|
|
|
Joined: Dec 2002
Posts: 3
Self-satisified door
|
Self-satisified door
Joined: Dec 2002
Posts: 3 |
5599395840917.999616 here too...
cpu: 1-AMD K6/2, 450MHz os: Windows 2000 Professional, Service Pack 3 (5.0 - 2195)
|
|
|
|
|
|