The code scales an array of floats into the [1 255] interval (G.hdr[5] and 
G.hdr[6] hold the min/max of the array), so it's not impossible that 
rounding errors may result in some values being equal to "255.000(...)eps". 
But is that forbidden? Apparently yes.

v0.3
julia> uint8(255.000000004)
0xff

v0.4
julia> UInt8(255.000000004)
ERROR: InexactError()

but than the deprecation message that tells us to use UInt8 instead of 
uint8 is wrong.



terça-feira, 31 de Março de 2015 às 13:38:46 UTC+1, René Donner escreveu:
>
> Not knowing the entire code, could it be that you are passing values > 255 
> to UInt8? And 'round' of e.g. 255.1 thus makes the error disappear? 
>
> julia> UInt8(255.0) 
> 0xff 
>
> julia> UInt8(255.1) 
> ERROR: InexactError() 
>  in call at base.jl:36 
>
> Regarding maintaining compatibility in your code for both 0.3 and 0.4, 
> take a look at https://github.com/JuliaLang/Compat.jl - it allows to 
> write your code for 0.4, and still have 0.3 be able to deal with it. 
>

I know about Compat.jl, but thanks anyway.

Reply via email to