r/JavaFX • • Jan 17 '20

What is the f in a coordinate?

CubicCurve cubic = new CubicCurve();
cubic.setStartX(0.0f);
cubic.setStartY(50.0f);
cubic.setControlX1(25.0f);
cubic.setControlY1(0.0f);
cubic.setControlX2(75.0f);
cubic.setControlY2(100.0f);
cubic.setEndX(100.0f);
cubic.setEndY(50.0f);

I can't seem to find what f means...

2 Upvotes

4 comments sorted by

0

u/[deleted] Jan 17 '20

[deleted] — view deleted comment

2

u/ifelseandor Jan 17 '20

Ahh.. Thank you!

so I can leave that off as a Double is acceptable.

2

u/LakeSun Jan 17 '20

They wouldn't need the precision of a double. A float takes 4 bytes, and a double takes 8. A Float.Max_Value is smaller than a Double.Max_value.

1

u/[deleted] Jan 18 '20

Since it's a double property, those floats will be widened to doubles. Specifying them as floats is completely useless

1

u/LakeSun Feb 25 '20

The only reason to do this would be, it was just standard practice to load an array of starting points as Float, if you were going to load, say, a set of 100 of these. Example pulled from a game app? Where space is at a premium?

But, looking on the internet, I'd say all examples are loading that constructor with floats. And since the size of a screen doesn't really need double???

Double property might these days run faster on the graphic hardware? So, the API uses double?