java - What will be the format of the double -


i have 1 function i.e applycredit(double amount )

if calling function applycredit(inputamount)

and inputamount in double 2 precision format i.e ####.00 if amount in function got updated several times

and question : format of amount 2 precision or may changed of type double

as long can "fit in" input can or without decimals

public static void main(string[] args) {     system.out.println(applycredit(2));     system.out.println(applycredit(2.66));     system.out.println(applycredit(2.72251)); } static private double applycredit(double amount ){     return amount*2; } 

will print : 4.0 , 5.32 , 5.44502


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -