| |
Java wierdness [now all is right with the world], Something wrong with my compy maybe
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
maybe your computer can't add
is there some way to have fixed decimal places?
This post has been edited by Xgoff on Nov 4 2005, 12:02 PM
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
Xgoff |
|

<):|
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/scg1.gif) ![Drawing Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/dcg1.gif) ![Drawing Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/dcr1.gif) ![MFGG Awards 2006 Winner [*]](https://archive.mfgg.net/html/badges/award06.gif)
![MFGG Awards 2007 Winner [*]](https://archive.mfgg.net/html/badges/award07.gif) ![Forum Event Badge [*]](https://archive.mfgg.net/html/badges/event.gif)

Group: Members
Posts: 52341
Member No.: 24
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
| QUOTE (Citrusponge @ Nov 5 2005, 09:21 AM) | So this is something that's meant to happen? Java sux then >:[ You sure? I can't just use integers here for my program. Some of the inputs *have* to be type double. That's not up to me. I can't convert them into integers without the compiler shouting POSSIBLE LOSS OF PRECISION at me  This especially sucks because without this problem my code would be perfect :<
*thinks of an idea which may or may not work* |
well your "possible loss of precision" would only be one one-hundred-quadrillionth off anyway so it probably wouldn't matter
--------------------
 DISCLAIMER: by sending me (xgoff) a private message, you agree to the directives and their terms specified henceforth: DIRECTIVE 1 (APPLE): i may or may not reply promptly or at all; and there are no guarantees to the usefulness of the reply. i may not acknowledge whether i have even received your private message DIRECTIVE 2 (CHILE CON CARNE): as per my view, "private" applies only to the initial transaction, and the material of your message may or may not be made public at my discretion; as this will more than likely be a post in the CCC or IRC, you may not be able to view it DIRECTIVE 3 (FEATHER DUSTER): you must address me (xgoff) as "Sir Master Xgofficus his Highest and Most Awesome the Third"; failure to comply with this term may invoke one or both of the above directives, and i will leave a burning bag of **** on your doorstep DIRECTIVE 4 (BOOTSTRAP): if you have read this disclaimer, please private message me promptly, in compliance with the above terms, so i can ensure you are capable of following directions you idiot this concludes the test of the emergency disclaimer system, your scheduled programming will now continue. satisfaction guaranteed, and 100% cash back available under certain circumstances; restrictions may or may not apply within your place of residence NOTICE: these directives and their terms may change at any time, without notice; as a private message transaction to myself assumes an understanding and full compliance of the above, you should ensure you are fully aware of the above terms at any point before sending a private message; any message received is assumed to have been sent in compliance with the above| QUOTE | (5:25:58 PM) Mikau: xgoff (5:26:00 PM) Mikau: guess what (5:26:04 PM) Xgoff: chicken butt (5:26:09 PM) Mikau: **** you |
|
|
|
Citrus |
|

not dead yet
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Winner Badge (2) [*]](https://archive.mfgg.net/html/badges/scg2.gif) ![Sprite Comp Runner Up Badge (4) [*]](https://archive.mfgg.net/html/badges/scr4.gif) ![Sprite Comp Top 5 Badge (3) [*]](https://archive.mfgg.net/html/badges/sct3.gif)

Group: Members
Posts: 18197
Member No.: 145
Joined: 19-November 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Java has two types for real numbers, 'double' and 'float'. My book says float is 'single-precision floating point' e.g. 43.889F And double is 'double-precision floating point' e.g. 45.63 or 2.4e5 I have no idea what that means  Except the F after the float specifies that it is indeed of type float. I don't like floating points. <<edit>> For anyone who cares: Float is even worse. Similar, should-be-predictable code: | CODE | float number = 0; while (number < 0.16) { number = number + 0.01F; System.out.println("number: " + number); } |
prints this:
| QUOTE | number: 0.01 number: 0.02 number: 0.03 number: 0.04 number: 0.049999997 number: 0.059999995 number: 0.06999999 number: 0.07999999 number: 0.08999999 number: 0.09999999 number: 0.109999985 number: 0.11999998 number: 0.12999998 number: 0.13999999 number: 0.14999999 number: 0.16 number: 0.17
|
This post has been edited by Citrusponge on Nov 5 2005, 02:02 PM
--------------------
|
|
|
Quicky |
|
a weed in glaber's garden
![Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/happyheart.gif)

Group: Members
Posts: 12957
Member No.: 7
Joined: 13-October 03
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
real numbers in java are represented with the exponent-coefficient (real men call it the mantissa ;) model, which is explained right herefloats are 32-bit numbers with a 24-bit mantissa and an 8-bit exponent, doubles are 64-bit with a 53-bit mantissa and 11-bit exponent, so in short doubles give you much more precision and a wider range of numbers man i'm on a roll This post has been edited by Quicky on Nov 5 2005, 02:01 PM
--------------------
the only good userbar on earth: 
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.0700 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 0.71 ]
| |