Skip to content

conversion and promotion to floats#35

Open
putianyi889 wants to merge 2 commits intoanj1:masterfrom
putianyi889:patch-1
Open

conversion and promotion to floats#35
putianyi889 wants to merge 2 commits intoanj1:masterfrom
putianyi889:patch-1

Conversation

@putianyi889
Copy link

No description provided.

@coveralls
Copy link

Coverage Status

coverage: 91.463% (-1.5%) from 93.004%
when pulling c0ba93e on putianyi889:patch-1
into 26f27c3 on anj1:master.

@fkastner
Copy link
Collaborator

Hi,
thanks for your interest in this project.
I'm not convinced that we want to have this promote_rule. Could you provide your rationale for choosing T over AlgebraicNumber as promoted type?
Also I would probably sort that under the existing "promotions" heading.

Less importantly, I wonder if we should provide a nicer error message for the case where one tries to cast a genuinely complex-valued AlgebraicNumber to float. But maybe the InexactError is already descriptive enough.

@putianyi889
Copy link
Author

Could you provide your rationale for choosing T over AlgebraicNumber as promoted type?

I think it's the same as irrationals.
https://github.com/JuliaLang/julia/blob/64de065a183ac70bb049f7f9e30d790f8845dd2b/base/irrationals.jl#L44-L52

Also I would probably sort that under the existing "promotions" heading.

The top comments of the file says it's meant to only support integers, but I could edit that anyway.

to cast a genuinely complex-valued AlgebraicNumber to float

I forgot algebraic numbers are complex. I'll add complex promotions as well.

@putianyi889 putianyi889 marked this pull request as draft March 26, 2024 14:13
@putianyi889 putianyi889 marked this pull request as ready for review March 27, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants