From 4f1561cfd7764925a73647980cc01a4d9df6b78b Mon Sep 17 00:00:00 2001 From: Jiahao Chen Date: Thu, 5 Mar 2015 18:29:20 -0500 Subject: [PATCH] Fix deprecation for iround on 0.4 Also fix typo in comments and update license years and licensees --- LICENSE.md | 2 +- REQUIRE | 1 + src/Showoff.jl | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 53c471f..4116026 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The Showoff.jl package is licensed under the MIT "Expat" License: -> Copyright (c) 2014: Daniel C. Jones. +> Copyright (c) 2014--2015: Daniel C. Jones and [other contributors](https://github.com/dcjones/Showoff.jl/graphs/contributors). > > Permission is hereby granted, free of charge, to any person obtaining > a copy of this software and associated documentation files (the diff --git a/REQUIRE b/REQUIRE index cdb1fac..c2a3c17 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,3 @@ julia 0.3- +Compat Iterators diff --git a/src/Showoff.jl b/src/Showoff.jl index 4971390..55af2a3 100644 --- a/src/Showoff.jl +++ b/src/Showoff.jl @@ -1,5 +1,6 @@ module Showoff +using Compat using Iterators export showoff @@ -86,7 +87,7 @@ function showoff{T <: FloatingPoint}(xs::AbstractArray{T}, style=:auto) delta = zero(T) end - x_min, x_max, delta = (float64(float32(x_min)), float64(float32(x_max)), + x_min, x_max, delta = (float64(float32(x_min)), float64(float32(x_max)), float64(float32(delta))) if !isfinite(x_min) || !isfinite(x_max) || !isfinite(delta) @@ -103,7 +104,7 @@ function showoff{T <: FloatingPoint}(xs::AbstractArray{T}, style=:auto) if VERSION < v"0.4-dev" if style == :plain - # SHORTEST_SINGLE rather than SHORTEST to crudely round away tiny innacuracies + # SHORTEST_SINGLE rather than SHORTEST to crudely round away tiny inaccuracies @grisu_ccall delta Base.Grisu.SHORTEST_SINGLE 0 precision = max(0, Base.Grisu.LEN[1] - Base.Grisu.POINT[1]) @@ -251,7 +252,7 @@ function format_fixed_scientific(x::FloatingPoint, precision::Integer, mag = log10(abs(x)) if mag < 0 - grisu_precision = precision + abs(iround(mag)) + grisu_precision = precision + abs(round(Integer, mag)) else grisu_precision = precision end