Forum - Space Odyssey MMORPG - a massive free online space game

Feedback Terminal => "Bugs" and Problems => Topic started by: drakken on May 18, 2008, 10:27:10 PM



Title: rounding
Post by: drakken 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:


Title: Re: rounding
Post by: Cameron07 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..


Title: Re: rounding
Post by: the broken 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


Title: Re: rounding
Post by: KenquinnTheInsaneOne on May 19, 2008, 10:49:25 PM
I reported this to Sir Emi a few days ago he says hes working on it


Title: Re: rounding
Post by: Chronos 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.


Title: Re: rounding
Post by: KenquinnTheInsaneOne 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


Title: Re: rounding
Post by: Chronos 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.


Title: Re: rounding
Post by: KenquinnTheInsaneOne 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


Title: Re: rounding
Post by: Chronos 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.


Title: Re: rounding
Post by: J-Bomb 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


Title: Re: rounding
Post by: KenquinnTheInsaneOne 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


Title: Re: rounding
Post by: Chronos 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..


Title: Re: rounding
Post by: KenquinnTheInsaneOne 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.


Title: Re: rounding
Post by: Chronos 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 (http://en.wikipedia.org/wiki/IEEE_floating-point_standard). 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.  :-\


Title: Re: rounding
Post by: Xealot 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...


Title: Re: rounding
Post by: KenquinnTheInsaneOne on July 27, 2008, 11:09:12 PM
heres a thing....why would emi be using signed variables, unsigned would probably be much better...think of that...
He using Java theres not such thing as unsigned variables. Unless you were to make them.