Yes, it is probably a binary operator but searches fail to find it.

Any use would also clash with Measurements.jl, so it'd be a bad idea anyway 
:-).

Thanks,
Kaj

On Wednesday, June 22, 2016 at 4:02:57 PM UTC+3, David van Leeuwen wrote:
>
> It probably is defined as an operator, but without definition.
>
> julia> ±(a,b) = (a+b, a-b)
> ± (generic function with 1 method) 
>
> julia> 3±4 
> (7,-1)
>
>
>
> your assignment probably overrides the default operator. 
>
>
> ---david
>
> On Wednesday, June 22, 2016 at 2:08:21 PM UTC+2, Kaj Wiik wrote:
>>
>>
>> I have a strange problem using ± and ∓ Unicode symbols as variables when 
>> placed at the front of equation. Although they seem not to be defined in 
>> Main, they behave differently from e.g. α (but e.g. 2*± does work). See 
>> below. Any suggestions?
>>
>>                _
>>    _       _ _(_)_     |  A fresh approach to technical computing
>>   (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
>>    _ _   _| |_  __ _   |  Type "?help" for help.
>>   | | | | | | |/ _` |  |
>>   | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
>>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
>> |__/                   |  x86_64-unknown-linux-gnu
>>
>> julia> α=-1.0
>> -1.0
>>
>> julia> α*2
>> -2.0
>>
>> help?> ±
>> search:
>>
>> Couldn't find ±
>> Perhaps you meant *, α, !, $, %, &, +, -, /, :, <, >, I, \, ^, e, |, ~, 
>> ×, ÷, γ or π
>> ERROR: "±" is not defined in module Main
>>  in error at error.jl:21
>>  in which_module at ./reflection.jl:315
>>  in call at ./docs/bindings.jl:8
>>
>> julia> ±=-1.0
>> -1.0
>>
>> julia> ±*2
>> ERROR: syntax: "±" is not a unary operator
>>
>> julia> ∓=-1.0
>> -1.0
>>
>> julia> ∓*2
>> ERROR: syntax: "∓" is not a unary operator
>>
>> julia> 2*±
>> -2.0
>>
>> julia> 2*∓
>> -2.0
>>
>>
>>

Reply via email to