#Why is it saying -0.85 is not greater than Float.MIN_VALE?

21 messages · Page 1 of 1 (latest)

blissful urchin
hazy vergeBOT
#

This post has been reserved for your question.

Hey @blissful urchin! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 720 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

sour vault
#

Have you executed the code and seen, what actually happens?

blissful urchin
#

yeah the inside of the if statement never runs (i can tell visually because all objects have no scale)

#

if i remove the if statement but keep the scale setting stuff thats inside it than they do have scale

#

so -0.85 is genuinely being counted as greater than Float.MIN_VALUE

#

i dont need the if statement at all im just wondering why it does that

sour vault
#

Hmmm, is scaleoffset a double or a float?

blissful urchin
#

float:

public Entity(EntityType type, Matrix4f matrix, float scaleOffset) {
    if (scaleOffset > Float.MIN_VALUE) {
        this.matrix.scale(this.type.size + scaleOffset);
    }
sour vault
#

Okay that is really weird. I mean, print out Float.MIN_VALUE?

#

Right before the if

blissful urchin
#

-0.07886315 is less than or equal to 1.4E-45
-0.4054676 is less than or equal to 1.4E-45
-0.61426634 is less than or equal to 1.4E-45
-0.5344303 is less than or equal to 1.4E-45
-0.5856453 is less than or equal to 1.4E-45
-0.51595694 is less than or equal to 1.4E-45
-0.581792 is less than or equal to 1.4E-45
-0.50864005 is less than or equal to 1.4E-45

#
public Entity(EntityType type, Matrix4f matrix, float scaleOffset) {
    this.type = type;
    this.matrix = matrix;
    if (scaleOffset > Float.MIN_VALUE) {
        this.matrix.scale(this.type.size + scaleOffset);
    } else {
        System.out.println(scaleOffset+" is less than or equal to "+Float.MIN_VALUE);
    }
}
sour vault
#

Interesting

blissful urchin
#

float's MIN_VALUE isnt the min value

#

its the min positive value

sour vault
#

But i didn't know either

blissful urchin
#

ig to get the real min value id just need to do -Float.MAX_VALUE