Mercurial Hosting > luan
comparison core/src/luan/modules/MathLuan.java @ 246:58752e3e4c5c
rename String.from_integers to char;
fix Math.random();
git-svn-id: https://luan-java.googlecode.com/svn/trunk@247 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Fri, 10 Oct 2014 02:23:19 +0000 |
parents | 0a8e6fdb62f0 |
children | 899253043270 |
comparison
equal
deleted
inserted
replaced
245:2ed8465a9d62 | 246:58752e3e4c5c |
---|---|
129 public static double random(Integer m,Integer n) { | 129 public static double random(Integer m,Integer n) { |
130 if( m==null ) | 130 if( m==null ) |
131 return Math.random(); | 131 return Math.random(); |
132 if( n==null ) | 132 if( n==null ) |
133 return Math.floor(m*Math.random()) + 1; | 133 return Math.floor(m*Math.random()) + 1; |
134 return Math.floor((n-m)*Math.random()) + m; | 134 return Math.floor((n-m+1)*Math.random()) + m; |
135 } | 135 } |
136 | 136 |
137 public static double sin(double x) { | 137 public static double sin(double x) { |
138 return Math.sin(x); | 138 return Math.sin(x); |
139 } | 139 } |