---
title: "Math.random()方法"
author: "jaywee"
date: "2008-11-29T10:41:06Z"
tags: []
slug: "math-random"
draft: false
lastmod: "2008-11-29T10:41:06Z"
id: 282802
url: "https://jaywee.iteye.com/blog/282802"
---

Math.random()方法生成0.0至1.0(不包含1.0)的double型随机数,一般地, a + Math.random() * b可以返回a到a+b之间的随机数,不包括a+b.