LEFT | RIGHT |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1997--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1997--2019 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 Rational trunc_rat () const; | 55 Rational trunc_rat () const; |
56 Rational div_rat (Rational) const; | 56 Rational div_rat (Rational) const; |
57 Rational mod_rat (Rational) const; | 57 Rational mod_rat (Rational) const; |
58 Rational abs () const; | 58 Rational abs () const; |
59 void negate (); | 59 void negate (); |
60 int to_int () const; | 60 int to_int () const; |
61 | 61 |
62 operator double () const { return to_double (); } | 62 operator double () const { return to_double (); } |
63 double to_double () const; | 63 double to_double () const; |
64 | 64 |
65 operator bool () const { return to_bool (); } | 65 operator bool () const { return sign_ != 0; } |
66 bool to_bool () const; | |
67 | 66 |
68 Rational operator - () const; | 67 Rational operator - () const; |
69 /** | 68 /** |
70 Initialize to 0. | 69 Initialize to 0. |
71 */ | 70 */ |
72 Rational (); | 71 Rational (); |
73 Rational (int); | 72 Rational (int); |
74 Rational (I64); | 73 Rational (I64); |
75 Rational (U64); | 74 Rational (U64); |
76 explicit Rational (I64, I64); | 75 explicit Rational (I64, I64); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 113 } |
115 | 114 |
116 #if 0 | 115 #if 0 |
117 ostream & | 116 ostream & |
118 operator << (ostream &, Rational); | 117 operator << (ostream &, Rational); |
119 #endif | 118 #endif |
120 | 119 |
121 const Rational infinity_rat (U64_MAX); | 120 const Rational infinity_rat (U64_MAX); |
122 | 121 |
123 #endif // RATIONAL_HH | 122 #endif // RATIONAL_HH |
LEFT | RIGHT |