Mercurial Hosting > luan
comparison core/src/luan/modules/MathLuan.java @ 566:90b93790c544
Number and Math documentation and minor changes
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Jul 2015 18:26:04 -0600 |
parents | fda38db30e65 |
children | b21d82ee5756 |
comparison
equal
deleted
inserted
replaced
565:22bfd8a2eaee | 566:90b93790c544 |
---|---|
52 | 52 |
53 public static double floor(double x) { | 53 public static double floor(double x) { |
54 return Math.floor(x); | 54 return Math.floor(x); |
55 } | 55 } |
56 | 56 |
57 public static double log(double x) { | 57 public static double fmod(double x,double y) { |
58 return Math.log(x); | 58 return x % y; |
59 } | |
60 | |
61 public static double log(double x,Double base) { | |
62 return base==null ? Math.log(x) : Math.log(x)/Math.log(base); | |
59 } | 63 } |
60 | 64 |
61 public static double min(double x,double... a) { | 65 public static double min(double x,double... a) { |
62 for( double d : a ) { | 66 for( double d : a ) { |
63 if( x > d ) | 67 if( x > d ) |
77 public static double[] modf(double x) { | 81 public static double[] modf(double x) { |
78 double i = (int)x; | 82 double i = (int)x; |
79 return new double[]{i,x-i}; | 83 return new double[]{i,x-i}; |
80 } | 84 } |
81 | 85 |
82 public static double pow(double x,double y) { | |
83 return Math.pow(x,y); | |
84 } | |
85 | |
86 public static double rad(double x) { | 86 public static double rad(double x) { |
87 return Math.toRadians(x); | 87 return Math.toRadians(x); |
88 } | 88 } |
89 | 89 |
90 public static double random(Integer m,Integer n) { | 90 public static double random(Integer m,Integer n) { |
97 | 97 |
98 public static double sin(double x) { | 98 public static double sin(double x) { |
99 return Math.sin(x); | 99 return Math.sin(x); |
100 } | 100 } |
101 | 101 |
102 public static double sinh(double x) { | |
103 return Math.sinh(x); | |
104 } | |
105 | |
106 public static double sqrt(double x) { | 102 public static double sqrt(double x) { |
107 return Math.sqrt(x); | 103 return Math.sqrt(x); |
108 } | 104 } |
109 | 105 |
110 public static double tan(double x) { | 106 public static double tan(double x) { |
111 return Math.tan(x); | 107 return Math.tan(x); |
112 } | 108 } |
113 | 109 |
114 public static double tanh(double x) { | 110 public static String long_to_string(long i,int radix) { |
115 return Math.tanh(x); | 111 return Long.toString(i,radix); |
116 } | |
117 | |
118 public static String long_to_string(long i,Integer radix) { | |
119 return radix==null ? Long.toString(i) : Long.toString(i,radix); | |
120 } | 112 } |
121 | 113 |
122 } | 114 } |