<?php /** * 大整数想乘 */ //数字1 $n1 = "8274918237591826391827591827391827"; //数字2 $n2 = "0000000000129837293586928391837492837592837491873498216359187234986239487"; //九九乘法表 $muti = array(); for ($i = 0; $i < 10; $i++) { for ($j = 0; $j < 10; $j++) { $muti[strval($i)][strval($j)] = $i * $j; } } //最长长度 $len_1 = strlen($n1); //最短长度 $len_2 = strlen($n2); //结果长度 $len_r = $len_1+$len_2+1; //运算结果 $result = array_fill(0, $len_r, 0); //数字反序 $n1 = strrev($n1); $n2 = strrev($n2); //按位运算 for ($i = 0; $i < $len_1; $i++) { for ($j = 0; $j < $len_2; $j++) { $result[$i + $j] += $muti[$n1[$i]][$n2[$j]]; } } //进位处理 $i = 0; $j = $len_r-1; do{ $result[$i + 1] += (int) ($result[$i] / 10); $result[$i] = $result[$i] % 10; } while (++$i

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools