Can unicode fraction symbols be used in equations

I’d like to use ½ in equations e.g.

X = 2
Y = ½X

Is this possible?
I just get error invalid character “½”

Julia places certain restrictions on what’s allowed for the first letter of a variable name - broadly speaking, alphabetical characters (in most languages) are okay, and numerical characters are not. However, you can use the ‘½’ character in any subsequent position. It won’t behave like a numeric literal, though - that juxtaposition behavior is only allowed for things like 0.5, 1//2, and 1/2:

julia> X = 2
2

julia> 0.5X
1.0

julia> (1/2)X
1.0

julia> (1//2)X
1//1

julia> Y = X½ = 0.5X
1.0

julia> X½
1.0
3 Likes

Thanks Alex