Jutho / RationalRoots.jl

A Julia type for representing square roots of rational numbers
Other
11 stars 3 forks source link

Support for HalfIntegers? #5

Open jagot opened 2 years ago

jagot commented 2 years ago

Would it be interesting to support HalfIntegers.jl?

Currently, I see the following:

julia> using HalfIntegers, RationalRoots

julia> signedroot(half(1))
0.7071067811865476

julia> signedroot(Rational(half(1)))
+√(1//2)
Jutho commented 9 months ago

Is this very important? Since there is no AbstractRational it is not so easy to do this. A package extension could be used, but that seems overkill.

I tried with signedroot(RationalRoot, half(1)), but that does not work because Base.rationalize(::HalfInteger) is not defined. That would probably be a useful addition to HalfIntegers.jl

jagot commented 9 months ago

Probably not very important :)