Permalink
Browse files

Revert "rand(Int32) now generates signed integers, both positive and …

…negative."

This reverts commit 7dcaeb5.
  • Loading branch information...
1 parent 7dcaeb5 commit c128b68770e43ce30c0a97b0dfbe3ee043c7cdb4 @ViralBShah ViralBShah committed Jan 26, 2013
Showing with 86 additions and 6 deletions.
  1. +3 −3 base/random.jl
  2. +48 −1 deps/Makefile
  3. +33 −0 deps/lighttpd.conf
  4. +2 −2 doc/stdlib/base.rst
View
@@ -122,9 +122,9 @@ rand(::Type{Uint32}) = dsfmt_randui32()
rand(::Type{Uint64}) = dsfmt_randui64()
rand(::Type{Uint128}) = uint128(rand(Uint64))<<64 | rand(Uint64)
-rand(::Type{Int32}) = int32(rand(Uint32))
-rand(::Type{Int64}) = int64(rand(Uint64))
-rand(::Type{Int128}) = int128(rand(Uint128))
+rand(::Type{Int32}) = int32(rand(Uint32)) & typemax(Int32)
+rand(::Type{Int64}) = int64(rand(Uint64)) & typemax(Int64)
+rand(::Type{Int128}) = int128(rand(Uint128)) & typemax(Int128)
for itype in (:Uint32, :Uint64, :Uint128, :Int32, :Int64, :Int128)
@eval begin
View
@@ -18,7 +18,7 @@ CONFIG_GUESS := $(shell ./config.guess)
CONFIGURE_COMMON += --host=$(XC_HOST) --build=$(CONFIG_GUESS)
endif
-#autoconf configure-driven scripts: llvm readline pcre arpack fftw unwind gmp glpk patchelf
+#autoconf configure-driven scripts: llvm readline pcre arpack fftw clp unwind lighttpd gmp glpk patchelf
#custom configure-driven script: zlib nginx
#custom Makefile rules: openlibm Faddeeva-wrapper rmath double-conversion random gmp-wrapper suitesparse-wrapper suitesparse lapack openblas uv tk-wrapper
@@ -54,6 +54,11 @@ ifeq ($(USE_SYSTEM_LLVM), 0)
STAGE1_DEPS += llvm
endif
+# Disable web repl
+#ifneq ($(OS),WINNT)
+#STAGE1_DEPS += lighttpd
+#endif
+
ifeq ($(OS),WINNT)
READLINE_VER = 5.0
endif
@@ -1075,6 +1080,48 @@ check-suitesparse-wrapper:
install-suitesparse-wrapper: $(BUILD)/lib/libsuitesparse_wrapper.$(SHLIB_EXT)
+## CLP ##
+CLP_OBJ_SOURCE = clp-$(CLP_VER)/Clp/src/.libs/libClp.$(SHLIB_EXT)
+CLP_OBJ_TARGET = $(BUILD)/lib/libClp.$(SHLIB_EXT)
+
+compile-clp: install-clp
+install-clp: $(CLP_OBJ_TARGET)
+
+clp-$(CLP_VER).tar.gz:
+ $(WGET_DASH_O) $@ http://www.coin-or.org/download/source/Clp/Clp-1.14.5.tgz
+clp-$(CLP_VER)/configure: clp-$(CLP_VER).tar.gz
+ mkdir -p clp-$(CLP_VER)
+ tar -C clp-$(CLP_VER) --strip-components 1 -zxf $<
+ touch -c $@
+clp-$(CLP_VER)/config.status: clp-$(CLP_VER)/configure
+ cd clp-$(CLP_VER) && \
+ ./configure $(CONFIGURE_COMMON) MPIF77="$(FC)" MPICXX="$(CXX)" MPICC="$(CC)"
+ touch -c $@
+$(CLP_OBJ_SOURCE): clp-$(CLP_VER)/config.status
+ $(MAKE) -C clp-$(CLP_VER)
+ touch -c $@
+clp-$(CLP_VER)/checked: $(CLP_OBJ_SOURCE)
+ifeq ($(OS),$(BUILD_OS))
+ $(MAKE) -C clp-$(CLP_VER) test
+endif
+ echo 1 > $@
+$(CLP_OBJ_TARGET): $(CLP_OBJ_SOURCE) clp-$(CLP_VER)/checked
+ $(MAKE) -C clp-$(CLP_VER) install
+ touch -c $@
+
+clean-clp:
+ -$(MAKE) -C clp-$(CLP_VER) clean
+ -rm -f $(CLP_OBJ_TARGET)
+distclean-clp:
+ -rm -rf clp-$(CLP_VER).tar.gz clp-$(CLP_VER)
+
+get-clp: clp-$(CLP_VER).tar.gz
+configure-clp: clp-$(CLP_VER)/config.status
+compile-clp: $(CLP_OBJ_SOURCE)
+check-clp: clp-$(CLP_VER)/checked
+install-clp: $(CLP_OBJ_TARGET)
+
+
## UNWIND ##
LIBUNWIND_TARGET_OBJ = $(BUILD)/lib/libunwind.a
View
@@ -0,0 +1,33 @@
+server.document-root = "../../ui/website"
+
+server.port = 2000
+
+server.modules = (
+ "mod_scgi",
+ "mod_access",
+ "mod_alias",
+ "mod_compress",
+ "mod_redirect",
+)
+
+mimetype.assign = (
+ ".html" => "text/html",
+ ".htm" => "text/html",
+ ".txt" => "text/plain",
+ ".jpg" => "image/jpeg",
+ ".png" => "image/png",
+ ".css" => "text/css",
+ ".js" => "application/javascript",
+)
+
+static-file.exclude-extensions = ( ".fcgi", "~", ".inc" )
+
+index-file.names = ( "index.html", "index.htm", "default.htm" )
+
+scgi.debug = 0
+scgi.server = (
+ ".scgi" =>
+ (( "host" => "127.0.0.1",
+ "port" => 2001
+ ))
+)
View
@@ -1396,9 +1396,9 @@ Random number generateion in Julia uses the `Mersenne Twister library <http://ww
Generate a random ``Float64`` array of the size specified by dims
-.. function:: rand(Int32|Uint32|Int64|Uint64|Int128|Uint128, [dims...])
+.. function:: rand(Int32|Uint32|Int64|Uint64)
- Generate a random integer of the given type. Optionally, generate an array of random integers of the given type by specifying dims.
+ Generate a random integer of the given type
.. function:: rand(r, [dims...])

0 comments on commit c128b68

Please sign in to comment.