Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文字列や配列の概念を使用せずに、倍精度数の実数部分と小数部分を別々に出力したいですか? printf() を使用して小数部分のみを出力する方法がわかりません。
入力 1: 13.31432 出力 1: 13 31432
入力 2: 15.36 出力 2: 15 36
実部は出力できますが、小数部は出力できません。
System.out.println((long)input); //Prints real part System.out.println(input - (long)input); //Prints decimal part