[julia-users] printing UInt displays hex instead of decimal

2015-09-16 Thread holocronweaver
In Julia 0.4rc1, when I create a UInt, either as an individual value or array, and then print it hex values are usually displayed instead of decimals. I say 'usually' because the behavior changes a bit between REPL and For instance: julia> a = UInt[1 2 3 4] 1x4 Array{UInt64,2}:

[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread holocronweaver
On Wednesday, September 16, 2015 at 5:38:30 PM UTC-4, Steven G. Johnson wrote: > It's not a bug, it's intentional. The feeling is that most applications > of UInt** types are using them as bitstrings, in which cases a hex display > is more useful. > UInt is very useful for catching signed

[julia-users] Return both elapsed time and expression return value

2015-09-11 Thread holocronweaver
The macros @time and @elapsed are handy for performance profiling, but when I want to test for both accuracy and performance regressions in my code I end up having to do the following: time = @elapsed(myfunc()) value = myfunc() Ideally there would be a macro which does both. Does such a thing

[julia-users] Re: Return both elapsed time and expression return value

2015-09-11 Thread holocronweaver
To be clear, I want a macro while allows me to do: value, time = @timeret(myfunc()) where myfunc() is only called once.

[julia-users] Inline built-in math functions

2015-08-02 Thread holocronweaver
Poking through the Julia source, I noticed that most built-in math functions do not have the @inline decorator (see base/complex.jl and base/intfuncs.jl for examples). When I added the decorator to a select group of base functions my code was using in tight loops, overall execution time

[julia-users] How are numbers converted to strings?

2015-07-31 Thread holocronweaver
How are numbers converted to strings in Julia? Specifically, where in the Julia source is this conversion performed? I ask because my x86 assembly implementation of 64-bit integer to string conversion is on average about 1.5x slower than Julia. Either Julia is doing something very smart, or

[julia-users] make iterators default in for-loops

2015-06-25 Thread holocronweaver
By default, Python 3 uses iterators for loop operations like zip and enumerate. Thus there is no need for a macro like @itr found in the Iterators.jl package. I am new to Julia and have difficulty understanding why the default behavior would not use iterators instead of tuples. Are there any