[RFC/WIP] unify the concepts of Fixed and UFixed#32
[RFC/WIP] unify the concepts of Fixed and UFixed#32vchuravy wants to merge 4 commits intoJuliaMath:masterfrom vchuravy:vc/unify_design
Conversation
src/FixedPointNumbers.jl
Outdated
|
I assume you're noting it's still failing, seemingly due to the "not quite 1" issue I raised above. We might need a different implementation of |
|
Need any help? I'd love to get this finished, tagged, and then be able to tag new versions for Colors/ColorTypes/ColorVectorSpace/Images etc. |
|
Any help is appreciated, grad school got a bit in the way :). I just pushed the last changes I have around, but I think I am still missing some cases. So one of the issues is that for signed types |
|
I added some comments, where I still have open questions and not necessary good answers. Essentially every bit of functionality that has a commented out version I was a bit unsure about. |
|
A fundamental problem I am running into that using Using A similar problem arises with signed fixedpoint numbers, where we need one bit to signal sign and so the question is if Maybe my brain is just going off on a tangent and I don't see the forest because of all the trees... |
|
You know, this rings a bell and is probably why I didn't unify them when I first wrote Sound reasonable? |
|
I am going to think this over, getting rid of a lot of code duplication would be really nice, but I don't really want to break the one major use case of FixedPointNumbers. (Even though UFixed should probably be called normalized numbers ;) ) |
|
Sounds good. I'll be out of touch for a couple of days. When I get back, I'll soon go ahead and tag a new release of Images and all related packages, just because it's overdue. If it takes a little longer to figure this out, that's fine---no rush. |
|
I am still interested in renaming |
|
I could go with such a renaming. (I probably won't do it myself, but happy to see it arrive, and even happier if someone helps fix the deprecations it will cause elsewhere 😉---EDIT: but don't worry about Images, that's in too much flux right now for anyone but me to touch.) |
After #27 UFixed and Fixed shared a lot of concepts and they do effectively the same thing, but sometimes a function is only implemented one way.
This is the current status of having only one type of FixedPoint and the underlying Type T defines whether it is a Unsigned or Signed type.
I added in comments the second implementation if the implementation is ambiguous and I haven't looked at the tests yet.
Merging those two concepts simplifies the code immensely, but it also highlights the subtle differences that where between Fixed and UFixed.