Skip to content

Commit

Permalink
use Compat for iceil
Browse files Browse the repository at this point in the history
  • Loading branch information
joehuchette committed Jan 11, 2015
1 parent 49afe38 commit 0c28c7f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/JuMPDict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,13 @@ Base.abs(x::JuMPDict) = map(abs, x)
# delegate one-argument functions
Base.size(x::JuMPArray,k) = size(x.innerArray,k)

if VERSION > v"0.4-"
iceil(x) = ceil(Integer, x)
end

function _local_index(indexsets, dim, k)
n = length(indexsets)
cprod = 1
for i in 1:(dim-1)
cprod *= length(indexsets[i])
end
idx = iceil(mod1(k,cprod*length(indexsets[dim])) / cprod)
idx = Compat.ceil(Integer, mod1(k,cprod*length(indexsets[dim])) / cprod)
return indexsets[dim][idx]
end

Expand Down

0 comments on commit 0c28c7f

Please sign in to comment.