Forum - Space Odyssey MMORPG - a massive free online space game
May 02, 2024, 01:12:34 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New game Astro Galaxy launched by ET Virtual Worlds, http://www.astro-galaxy.com
 
   Home   Help Search Members Login Register  
Pages: [1] 2
  Send this topic  |  Print  
Author Topic: rounding  (Read 6601 times)
drakken
Sergeant
*

Reputation: +21/-10
Offline Offline

Posts: 211



View Profile WWW
« on: May 18, 2008, 10:27:10 PM »

 14  annoying how the game cant handle numbers when designing in the quad credit ships..i have 60606061037521099 energy available and when i make the weapon it rounds the energy to 60606061037521104.  its not a bug but it is a problem. lazy people. bags.now i have 96 energy left on my ship  4
Report to moderator   Logged

Peace And Happy Hunting
Cameron07
Master Sergeant
*

Reputation: +154/-76
Offline Offline

Posts: 1376


View Profile
« Reply #1 on: May 19, 2008, 02:13:50 AM »

ive had the same problem before.. when u get to the bigger ships certain ones are weird like that..
Report to moderator   Logged

21
the broken
Sergeant
*

Reputation: +44/-7
Offline Offline

Posts: 204


View Profile WWW
« Reply #2 on: May 19, 2008, 04:26:08 AM »

a good problem is 2 creds for the powercore instead of 3 but ive also noticed the same thing but thought the spreadsheet i used was slightly off as well
Report to moderator   Logged



KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #3 on: May 19, 2008, 10:49:25 PM »

I reported this to Sir Emi a few days ago he says hes working on it
Report to moderator   Logged
Chronos
Sergeant First Class
*

Reputation: +144/-14
Offline Offline

Posts: 612

Make your swords become like things unto chainsaws


View Profile
« Reply #4 on: May 20, 2008, 12:57:24 PM »

Huh... exactly fourteen digits of accuracy. It seems to look like Sir Emi's using double's to store that stuff in.

double's are nice, they have a range of about 4.94e-324 to 1.80e+308, but they only have about fourteen digits of accuracy.


(Added:) Signed, Java double's, anyway.
« Last Edit: May 20, 2008, 07:53:37 PM by Chronos » Report to moderator   Logged

KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #5 on: May 20, 2008, 04:06:21 PM »

Huh... exactly fourteen digits of accuracy. It seems to look like Sir Emi's using double's to store that stuff in.

double's are nice, they have a range of about 4.94e-324 to 1.80e+308, but they only have about fourteen digits of accuracy.
Odd since he is dealing with such large numbers he should of used BigDecimal's and not Doubles
Report to moderator   Logged
Chronos
Sergeant First Class
*

Reputation: +144/-14
Offline Offline

Posts: 612

Make your swords become like things unto chainsaws


View Profile
« Reply #6 on: May 20, 2008, 07:42:11 PM »

Hum, maybe that's what he's working on.

Big number objects create a higher stress on the server than primitive double's, though. So that must be taken into account.
Report to moderator   Logged

KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #7 on: May 21, 2008, 01:20:53 AM »

Hum, maybe that's what he's working on.

Big number objects create a higher stress on the server than primitive double's, though. So that must be taken into account.
He may already be using a BigDecimal just tried the value of: 151,515,215,584,812,151 it's 18 digits long and it change it to 151,515,215,584,812,160 still 18 digits long. But with only 17 digits of precision. If he was using a double would it not be rounded to 151,515,215,584,80,000?

Edit: I'll dig up my Java book and see how many digits of precision a double has
« Last Edit: May 21, 2008, 01:27:36 AM by Kenquinn » Report to moderator   Logged
Chronos
Sergeant First Class
*

Reputation: +144/-14
Offline Offline

Posts: 612

Make your swords become like things unto chainsaws


View Profile
« Reply #8 on: May 21, 2008, 12:59:18 PM »

That not exactly how doubles work, I do believe.

If I recall correctly, each bit of a floating point number is worth something along the lines of 2^(-n). It is not simply a integer with a magnitude. You could get infinite precision for a very specific set of numbers.

And your number looks like it only has sixteen digits of accuracy, since the last two are incorrect. Though I may counting accuracy wrong.
Report to moderator   Logged

J-Bomb
Guest
« Reply #9 on: May 21, 2008, 02:57:55 PM »

>  you can move this not sure if it is a bug ok <


you say about the energy lefl over ok

first the energy gose over making a trill ship

energy = 16534

and i done it 1o times and i have been just adding it on the powercore but everytime you make a ship it get very  21

so i told LIGHT about it and he just dont worry about it but at the end of the game the ship is wrong

plzs get it done

Thankyou

J-Bomb
Report to moderator   Logged
KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #10 on: May 21, 2008, 06:23:46 PM »

That not exactly how doubles work, I do believe.

If I recall correctly, each bit of a floating point number is worth something along the lines of 2^(-n). It is not simply a integer with a magnitude. You could get infinite precision for a very specific set of numbers.

And your number looks like it only has sixteen digits of accuracy, since the last two are incorrect. Though I may counting accuracy wrong.
Your right only 16 digits are accurate but 17 are significant digits.

If you want to brush up on the exact rules you can go here: http://www.physics.uoguelph.ca/tutorials/sig_fig/SIG_dig.htm
Report to moderator   Logged
Chronos
Sergeant First Class
*

Reputation: +144/-14
Offline Offline

Posts: 612

Make your swords become like things unto chainsaws


View Profile
« Reply #11 on: May 21, 2008, 08:04:36 PM »

Myes, myes.

Of course, one must remember, computers don't really care about the preconceived notion of significant digits. The numbers either have a fixed precision, or they store the precision in a member variable. How many digits, whether "significant" or not, that get outputed depends primarily on the specific string conversion function.

In this case, the floating-point number is outputed in standard form, rather than scientific form. Thus all of the digits until the decimal place are sent, accurate or no, out of necessity.

(Added:) The extra digits are not set to zero, they are mearly a continuation of the approximation made by the bits in the primitive..
« Last Edit: May 21, 2008, 08:21:12 PM by Chronos » Report to moderator   Logged

KenquinnTheInsaneOne
Master Sergeant
*

Reputation: +61/-63
Offline Offline

Posts: 930


View Profile
« Reply #12 on: May 22, 2008, 12:47:08 PM »

Myes, myes.

Of course, one must remember, computers don't really care about the preconceived notion of significant digits. The numbers either have a fixed precision, or they store the precision in a member variable. How many digits, whether "significant" or not, that get outputed depends primarily on the specific string conversion function.

In this case, the floating-point number is outputed in standard form, rather than scientific form. Thus all of the digits until the decimal place are sent, accurate or no, out of necessity.

(Added:) The extra digits are not set to zero, they are merely a continuation of the approximation made by the bits in the primitive..
You are quite correct. Also I calculated the Maximum signed value that can be represented by the 64 bits in a doulbe it's: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Of course this is assuming the bits in a doulbe can be all used to represent either a base 2 number/decimal number/scientific notation. I somewhat remember a c++ doulbe have specific bits assigned to +/-/normal binary number/scientific notation

Well it is not really the maximum value you can represent it's the maximum sighed value that can be represented without using bits to represent scientific notation.
You may of noticed 9,223,372,036,854,775,807 + 193 = 9,223,372,036,854,776,000 or max power.
Report to moderator   Logged
Chronos
Sergeant First Class
*

Reputation: +144/-14
Offline Offline

Posts: 612

Make your swords become like things unto chainsaws


View Profile
« Reply #13 on: May 22, 2008, 07:42:30 PM »

You are quite correct. Also I calculated the Maximum signed value that can be represented by the 64 bits in a doulbe it's: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Erm, those are the extreme values of the long data-type. (Or long long data-type, for the old geezers.)

Of course this is assuming the bits in a doulbe can be all used to represent either a base 2 number/decimal number/scientific notation.

When I refer to double, I am talking about the standard double-precision floating point type, used by most languages, usually described by IEEE 754-1985. This type has only one form: [Sign:1 | Exponent:11 | Significand:52]

I believe these doubles have a range of ±4,503,599,627,370,496 when representing exact integers. Otherwise, their range is ≈ ± 1.80(10308) to ±2.23(10-308). It's the same bit-form either way, though

I somewhat remember a c++ doulbe have specific bits assigned to +/-/normal binary number/scientific notation

C++ is a strongly typed language, and its floating-point primitives are system-dependent. However, C++ floats and doubles act like IEEE 754-1985 floating-point numbers almost ubiquitously, I think.

You may of noticed 9,223,372,036,854,775,807 + 193 = 9,223,372,036,854,776,000 or max power.

No, I have not noticed that. But I fail to see its significance.  :-\
Report to moderator   Logged

Xealot
Private
*

Reputation: +1/-1
Offline Offline

Posts: 11


View Profile
« Reply #14 on: June 23, 2008, 09:54:36 AM »

heres a thing....why would emi be using signed variables, unsigned would probably be much better...think of that...
Report to moderator   Logged
Pages: [1] 2
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!