David K. Zhang
David K. Zhang
Hey, I'm the author of [MultiFloats.jl](https://github.com/dzhang314/MultiFloats.jl), a new Julia package for extended precision arithmetic. I'd like to make my `MultiFloat{T,N}` type compatible with Optim.jl, but unfortunately I don't have an...
``` python foo + 3 # => ReferenceError: foo is not defined undefined + 3 # no problem ```
``` python def foo(xs=[]): xs.append(5) return xs self.say(foo()) # produces "[]"; correct output is "[5]" self.say(foo()) # produces "[]"; correct output is "[5, 5]" self.say(foo()) # produces "[]"; correct output...
Currently, adding a string to a number (in either order) casts the number to a string and concatenates: ``` python "abc" + 123 == "abc123" 123 + "abc" == "123abc"...
``` python a = {1: "I'm an int", 1.0: "I'm a float", "1": "I'm a string"} self.say(a[1]) # => "I'm a string" self.say(a[1.0]) # => "I'm a string" self.say(a["1"]) #...
``` python {(0, 1): 'y step', (1, 0): 'x step', (0, 0): 'origin'} ``` This is a perfectly valid `dict` literal but throws `SyntaxError: Unexpected token` in Filbert.
Consider the following Julia code: ``` module M struct MyNumber sign::Bool exponent::Int mantissa::Int end function BigFloat(::MyNumber) ... end function cube_root(x::BigFloat) ... end end # module M ``` This yields blue...
Consider the following Julia code: ``` module M struct Container{T} value::T end const IntContainer = Container{Int} function IntContainer(x::Float64) return IntContainer(round(Int, x)) end end # module M ``` This yields blue...