diff options
author | Roman Kennke <roman@kennke.org> | 2007-05-24 20:56:35 +0000 |
---|---|---|
committer | Roman Kennke <roman@kennke.org> | 2007-05-24 20:56:35 +0000 |
commit | 4038e1edf3cc3ad4eb53f873ecf6a2fd1565c695 (patch) | |
tree | 4f32e8b7cde173060a183db67cd39521483144f9 | |
parent | c559b24555d6917692118aa0245958918d389201 (diff) | |
download | classpath-4038e1edf3cc3ad4eb53f873ecf6a2fd1565c695.tar.gz |
2007-05-24 Roman Kennke <roman@kennke.org>
* gnu/java/math/Fixed.java
(trunc): New method.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gnu/java/math/Fixed.java | 13 |
2 files changed, 18 insertions, 0 deletions
@@ -1,5 +1,10 @@ 2007-05-24 Roman Kennke <roman@kennke.org> + * gnu/java/math/Fixed.java + (trunc): New method. + +2007-05-24 Roman Kennke <roman@kennke.org> + * gnu/java/awt/java2d/AbstractGraphics2D.java (fillShape): Pass rendering hints to scanline converter. * gnu/java/awt/java2d/ScanlineConverter.java diff --git a/gnu/java/math/Fixed.java b/gnu/java/math/Fixed.java index e0284c329..ed4150b10 100644 --- a/gnu/java/math/Fixed.java +++ b/gnu/java/math/Fixed.java @@ -109,6 +109,19 @@ public final class Fixed } /** + * Truncates the number so that only the digits after the point are left. + * + * @param n the number of digits + * @param a the fixed point value + * + * @return the truncated value + */ + public static int trunc(int n, int a) + { + return a & (0xFFFFFFFF >>> 32 - n); + } + + /** * Returns the round value of a fixed point value <code>a</code> with * the <code>n</code> digits. * |