- **labels**:  --> Fixed_2_21_0
- **status**: Started --> Fixed
- **Patch**: push -->  
- **Comment**:

```text
commit 1a061b0d2b7e3b50c8f2846008882325dfe1fec8
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 22:10:33 2020 -0500

    Issue 5790/8: Rational: to_int () becomes trunc_int ()
    
    ... and returns I64 like num () and den ().
```
```text
commit f0e68ea3a9c8db6d7b81a3f7fd797804b26c9cbf
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 12:53:31 2020 -0500

    Issue 5790/7: Rational: disable implicit conversion to double
    
    This helps emphasize places where exactness might be lost.
```
```text
commit 95bf2fde4b95969875dd2cfe96b4424175ca3885
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 12:53:31 2020 -0500

    Issue 5790/6: Rational: r.to_double () becomes static_cast<double> (r)
    
    This helps developers avoid question-raising statements like this:
    
        Real x = r.to_double ();
    
    and encourages statements like this:
    
        auto x = static_cast<Real> (r);
```
```text
commit 7cfd8a44caa6d7e1de02b0c8e3ffa501fb9f4bce
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 12:53:31 2020 -0500

    Issue 5790/5: Rational: disable implicit conversion to bool

```
```text
commit b8028efa6daf9e2be3617bf6ff9dd8b13d303bb0
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 22:09:42 2020 -0500

    Issue 5790/4: Rational: disambiguate integer conversions
    
    ... and fix sign when initialized by unsigned integer

```
```text
commit 532e06e784035bf3fdbedb590cf4e6fe070178e2
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 09:17:12 2020 -0500

    Issue 5790/3: Rational: use default copy-construction and assignment

```
```text
commit 2a7c4146cac93710d02106c8f729b8e7333e656d
Author: Dan Eble <[email protected]>
Date:   Sat Feb 22 12:45:18 2020 -0500

    Issue 5790/2: Rational: remove unused infinity_rat

```
```text
commit 8466b6dbc630d1862f193d081f6de7ae9a4a1d3d
Author: Dan Eble <[email protected]>
Date:   Fri Feb 21 18:26:04 2020 -0500

    Issue 5790/1: Rational: create unit tests

```



---

** [issues:#5790] Rational conversion clean-up**

**Status:** Fixed
**Labels:** Fixed_2_21_0 
**Created:** Tue Feb 25, 2020 02:43 AM UTC by Dan Eble
**Last Updated:** Fri Feb 28, 2020 08:50 AM UTC
**Owner:** Dan Eble


This review squashes these commits that mainly clean up initialization
and conversion of Rationals, though there are some minor bug fixes.

For most of the unit tests which are disabled here, I have fixes that
I am holding back for the sake of simplifying this review.

1: create unit tests

2: remove unused infinity_rat

3: use default copy-construction and assignment

4: disambiguate integer conversions
   and fix sign when initialized by unsigned integer

5: disable implicit conversion to bool

6: discard r.to_double () in favor of static_cast<double> (r)
   This helps developers avoid question-raising statements like this:
       Real x = r.to_double ();
   and encourages statements like this:
       auto x = static_cast<Real> (r);

7: disable implicit conversion to double
   This helps emphasize places where exactness might be lost.

8: to_int () becomes trunc_int ()
   and returns I64 like num () and den ().

https://codereview.appspot.com/573570043


---

Sent from sourceforge.net because [email protected] is 
subscribed to https://sourceforge.net/p/testlilyissues/issues/

To unsubscribe from further messages, a project admin can change settings at 
https://sourceforge.net/p/testlilyissues/admin/issues/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.
_______________________________________________
Testlilyissues-auto mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/testlilyissues-auto
  • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development
    • ... Auto mailings of changes to Lily Issues via Testlilyissues-auto via Automated messages for lilypond development

Reply via email to