zoukankan      html  css  js  c++  java
  • java.lang.Math.max 和min方法

    java.lang.Math.max 和min方法

    Modifier and Type 方法 描述
    static double max(double a, double b) 返回两个 double中的较大值。
    static float max(float a, float b) 返回两个 float中的较大值。
    static int max(int a, int b) 返回两个 int中的较大值。
    static long max(long a, long b) 返回两个 long中的较大值。
    static double min(double a, double b) 返回两个 double中的较小值。
    static float min(float a, float b) 返回两个 float中的较小值。
    static int min(int a, int b) 返回两个 int中的较小值。
    static long min(long a, long b) 返回两个 long中的较小值。

    max(double a, double b)

    public class TestMax {
        public static void main(String[] args) {
            test();
        }
        //测试  max(double a,  double b)方法
        public static void test(){
            double max = Math.max(1.233, 1.2334);
            System.out.println("最大值是:"+max);
        }
    }
    
    最大值是:1.2334
    
  • 相关阅读:
    python-历史
    10-函数命名空间,作用域,嵌套,闭包
    centos7 搭建dns服务器
    centos7 搭建dhcp服务器
    Nginx 启用 gzip 压缩
    Eclipse 个人手册
    Nginx 命令
    定时任务
    系统设计
    根据 xsd 生成 jaxb java 类
  • 原文地址:https://www.cnblogs.com/sweetorangezzz/p/12907234.html
Copyright © 2011-2022 走看看