It’s generally not good form to refer people to other unresolved questions in order to answer your question. Don’t make people do work in order to understand what you’re asking. See also: Please read: make it easier to help you

It’s pretty common in programming languages for booleans true and false to be represented by 1 and 0 respectively. In python, they are literally the same (1 == True). In Julia, they’re not the same thing, but you can convert a Bool into a number as you’ve shown. To reiterate:

I could not get a struct called mynum to have it’s inverse calculated properly as a square matrix

When I traced how a square matrix of type Float64 is transformed into its inverse

there is a strange call Float64(true)

at LinearAlgebra.jl/blob/master/src/uniformscaling.jl

## Matrix construction from UniformScaling
function Matrix{T}(s::UniformScaling, dims::Dims{2}) where {T}
A = zeros(T, dims)
v = T(s.λ)
for i in diagind(dims...)
@inbounds A[i] = v
end
return A
end

Where " v = T(s.λ) " becomes v = Float64(true)

julia> Float64(I.λ)
1.0
julia> I.λ
true

and subsequently I need to create a mynum(x::Bool) before my struct mynum can have its inverse calculated.

So my question is what is the purpose of Float64(x::Bool)

As others have explained it’s an established (and quite useful) convention in programming languages, but also in mathematics, to associate true and false with the values 1 and 0. I believe what you rather want to ask is why the implementation of inv chooses to make use of this convention.

Afaik, the general convention for number types is that T(true) == one(T) and T(false) == zero(T), i.e.~you should get the neutral elements for addition and multiplication in your field / ring / approximate field, and true * x == x, and false * x == zero(typeof(x)).

Note the hard zero: E.g. 0*Inf is NaN, but false*Inf is 0.0.

I guess that shows me for running my mouth without checking . I knew there was a way they were different from python, and this is definitely what I was thinking. Thanks for the clarification!