Use default float in Java (Eclipse)

I am looking for a path search, so I don’t need to add 'f' to all my doublings when programming: for example:

FunctionTakingLotsOfFloatsAsParameter( 1.1f , 2.2f , 3.3f , 4.4 );

I want to write this instead:

FunctionTakingLotsOfFloatsAsParameter( 1.1 , 2.2 , 3.3 , 4.4 );

Is there a way to make a compiler that creates a float instead of a double as a standard non-integer number?

+3
source share
2 answers

No. It is fixed in the language specification .

Keep in mind, well, that it would be one hell of a debugging session to find the reason for the sudden loss of accuracy in some assemblies compared to the same code as with another compiler.

Java , ( C) . , , , .

+7

. ? , , .

+4

Source: https://habr.com/ru/post/1795456/


All Articles