/******************************************************************************
* Compilation: javac DoubleOps.java
* Execution: java DoubleOps a b
*
* Illustrates the integer operations a + b, a * b, and a / b.
*
* % java DoubleOps 1234 99
* 1234.0 + 99.0 = 1333.0
* 1234.0 * 99.0 = 122166.0
* 1234.0 / 99.0 = 12.464646464646465
* 1234.0 % 99.0 = 46.0
*
* % java DoubleOps 10 -3
* 10.0 + -3.0 = 7.0
* 10.0 * -3.0 = -30.0
* 10.0 / -3.0 = -3.3333333333333335
* 10.0 % -3.0 = 1.0
*
* % java DoubleOps Infinity 3
* Infinity + 3.0 = Infinity
* Infinity * 3.0 = Infinity
* Infinity / 3.0 = Infinity
* Infinity % 3.0 = NaN
*
******************************************************************************/ public class DoubleOps { public static void main(String[] args) {
double a = Double.parseDouble(args[0]);
double b = Double.parseDouble(args[1]);
double sum = a + b;
double prod = a * b;
double quot = a / b;
double rem = a % b; System.out.println(a + " + " + b + " = " + sum);
System.out.println(a + " * " + b + " = " + prod);
System.out.println(a + " / " + b + " = " + quot);
System.out.println(a + " % " + b + " = " + rem); System.out.println();
System.out.println("sin(pi/2) = " + Math.sin(Math.PI/2));
System.out.println("log(e) = " + Math.log(Math.E));
}
}

最新文章

  1. C#打开关闭数据库连接
  2. /proc/interrupts 统计2.6.38.8与3.10.25差异
  3. 【BZOJ-4590】自动刷题机 二分 + 判定
  4. <meta>标签元素的属性理解
  5. 【转】C#进阶系列——WebApi 接口参数不再困惑:传参详解
  6. MVC5+EF6简单实例---以原有SQLServer数据库两表联合查询为例
  7. 【Xamarin报错】AndroidManifest.xml : warning XA0101: @(Content) build action is not supported
  8. Linux下挂载NTFS格式的U盘或硬盘
  9. Could not write metadata for '/taiping-sol-insu-composite'.
  10. css中图片的四种地址引用
  11. 从零开始学习MySQL1---MySQL基础
  12. 玩转Win32开发(2):完整的开发流程
  13. Delphi组件开发-在窗体标题栏添加按钮(使用MakeObjectInstance(NewWndProc),并处理好多消息)
  14. Less和Sass的使用
  15. Maste Note for OCR / Vote disk Maintenance Operations (ADD/REMOVE/REPLACE/MOVE)
  16. vim 实用配置
  17. 笔记:Maven Web项目
  18. java编程行业微信群,无论新手老手欢迎加入,会一直更新
  19. bean 装配
  20. 712. Minimum ASCII Delete Sum for Two Strings

热门文章

  1. 美食应用 吃了么 beta 测试报告
  2. Docker for windows 入门一(下载安装)
  3. 使用非服务器磁盘(MBROnly)安装ESXi时的方法.
  4. 日常工作: 应用服务器Oracle驱动问题说明
  5. python学习笔记四——循环及冒泡排序
  6. rsync实现数据同步
  7. java程序在windows系统作为服务程序运行
  8. codeforces279B
  9. BZOJ3172[Tjoi2013]单词——AC自动机(fail树)
  10. importlib 模块