08. 详解 Math 类以及大数运算
java.lang.Math(final 类)
Java 语言是彻底地面向对象语言,哪怕是进行数学运算也封装到一个类中的,这个类是 java.lang.Math,Math 类是 final 的不能被继承。Math 类中包含用于进行基本数学运算的方法,如指数、对数、平方根和三角函数等。这些方法分类如下:
1. 舍入方法
static double ceil(double a)
:返回大于或等于 a 最小整数。static double floor(double a)
:返回小于或等于 a 最大整数。static int round(float a)
:四舍五入方法。
2. 最大值和最小值
static int min(int a, int b)
:取两个 int 整数中较小的一个整数。static int min(long a, long b)
:取两个 long 整数中较小的一个整数。static int min(float a, float b)
:取两个 float 浮点数中较小的一个浮点数。static int min(double a, double b)
:取两个 double 浮点数中较小的一个浮点数。
max 方法取两个数中较大的一个数,max 方法与 min 方法参数类似也有 4 个版本,这里不再赘述。
网络加速软件 推荐
机场
优质机场文章
- ssr 粉色的小飞机(酸酸乳)
- v2rayNG
- shadowsocks
- Hiddify
若自己使用 shadowsocks 搭代理 缺点是无法限制每月总流量,可能被坑超出的外网流量费。
- 【server】shadowsocks-rust- A Rust port of shadowsocks <https://github.com/* shadowsocks/shadowsocks-rust>
- 【win】shadowsocks-windows- A C# port of shadowsocks <https://github.com/* shadowsocks/shadowsocks-windows>
- 【mac】ShadowsocksX-NG- Next Generation of ShadowsocksX <https://github.com/* shadowsocks/ShadowsocksX-NG>
- 【android】shadowsocks-android- A shadowsocks client for Android https://github.com/shadowsocks/shadowsocks-android
Markdown-拓展 Docsify 主题美化
docsify-themeable - A delightfully simple theme system for docsify.js
https://jhildenbiddle.github.io/docsify-themeable/#/
Quick Start
Installation
- Create a docsify site by following the instructions on the docsify.js website.