Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Provide methods on j.l.Math reqd by the library

  • Loading branch information...
commit 04f5b5ee61ae2d261d10b6df4e187d2fb899014c 1 parent 85e8cc7
Geoff Reedy authored July 28, 2011

Showing 1 changed file with 44 additions and 0 deletions. Show diff stats Hide diff stats

  1. 44  docs/examples/llvm/runtime.scala
44  docs/examples/llvm/runtime.scala
@@ -2,8 +2,52 @@ import scala.ffi._
2 2
 package java {
3 3
   package lang {
4 4
     object Math {
  5
+      private def TODO = error("unimplemented")
5 6
       @foreign("sqrt")
6 7
       def sqrt(d: scala.Double): scala.Double = error("foregin")
  8
+      def log10(x: scala.Double): scala.Double = TODO
  9
+      def cbrt(x: scala.Double): scala.Double = TODO
  10
+      def ulp(x: scala.Double): scala.Double = TODO
  11
+      def ulp(x: scala.Float): scala.Float = TODO
  12
+      def sinh(x: scala.Double): scala.Double = TODO
  13
+      def cosh(x: scala.Double): scala.Double = TODO
  14
+      def tanh(x: scala.Double): scala.Double = TODO
  15
+      def hypot(x: scala.Double, y: scala.Double): scala.Double = TODO
  16
+      def expm1(x: scala.Double): scala.Double = TODO
  17
+      def log1p(x: scala.Double): scala.Double = TODO
  18
+      final val E: scala.Double = 2.718281828459045
  19
+      final val PI: scala.Double = 3.141592653589793
  20
+      def random(): scala.Double = TODO
  21
+      def sin(x: scala.Double): scala.Double = TODO
  22
+      def cos(x: scala.Double): scala.Double = TODO
  23
+      def tan(x: scala.Double): scala.Double = TODO
  24
+      def asin(x: scala.Double): scala.Double = TODO
  25
+      def acos(x: scala.Double): scala.Double = TODO
  26
+      def atan(x: scala.Double): scala.Double = TODO
  27
+      def toRadians(x: scala.Double): scala.Double = TODO
  28
+      def toDegrees(x: scala.Double): scala.Double = TODO
  29
+      def exp(x: scala.Double): scala.Double = TODO
  30
+      def log(x: scala.Double): scala.Double = TODO
  31
+      def IEEEremainder(x: scala.Double, y: scala.Double): scala.Double = TODO
  32
+      def ceil(x: scala.Double): scala.Double = TODO
  33
+      def floor(x: scala.Double): scala.Double = TODO
  34
+      def rint(x: scala.Double): scala.Double = TODO
  35
+      def atan2(y: scala.Double, x: scala.Double): scala.Double = TODO
  36
+      def pow(x: scala.Double, y: scala.Double): scala.Double = TODO
  37
+      def round(x: scala.Float): scala.Int = TODO
  38
+      def round(x: scala.Double): scala.Long = TODO
  39
+      def abs(x: scala.Int): scala.Int = TODO
  40
+      def abs(x: scala.Long): scala.Long = TODO
  41
+      def abs(x: scala.Float): scala.Float = TODO
  42
+      def abs(x: scala.Double): scala.Double = TODO
  43
+      def max(x: scala.Int, y: scala.Int): scala.Int = if (x > y) x else y
  44
+      def max(x: scala.Long, y: scala.Long): scala.Long = if (x > y) x else y
  45
+      def max(x: scala.Float, y: scala.Float): scala.Float = if (x > y) x else y
  46
+      def max(x: scala.Double, y: scala.Double): scala.Double = if (x > y) x else y
  47
+      def min(x: scala.Int, y: scala.Int): scala.Int = if (x < y) x else y
  48
+      def min(x: scala.Long, y: scala.Long): scala.Long = if (x < y) x else y
  49
+      def min(x: scala.Float, y: scala.Float): scala.Float = if (x < y) x else y
  50
+      def min(x: scala.Double, y: scala.Double): scala.Double = if (x < y) x else y
7 51
     }
8 52
     class Error(message: String, cause: Throwable) extends Throwable(message, cause) {
9 53
       def this() = this(null, null)

0 notes on commit 04f5b5e

Please sign in to comment.
Something went wrong with that request. Please try again.