mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Avoid minor rounding errors.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22807 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
504edc1c85
commit
4185b2524b
2 changed files with 18 additions and 13 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-04-24 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSCalendarDate.m: Avoid a couple of minor rounding errors
|
||||
by using floating point constants for millisecond multipliers.
|
||||
|
||||
2006-04-24 Alex Perez <aperez@alexperez.com>
|
||||
|
||||
* Source/NSProcessInfo.m: Elaborated upon the
|
||||
|
|
|
@ -268,7 +268,7 @@ GSBreakTime(NSTimeInterval when, int *year, int *month, int *day,
|
|||
m = m * 60;
|
||||
c = a - h - m;
|
||||
*second = (int)c;
|
||||
*mil = (a - h - m - c) * 1000;
|
||||
*mil = (int)((a - h - m - c) * 1000.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1897,7 +1897,7 @@ static void Grow(DescriptionInfo *info, unsigned size)
|
|||
s -= (_seconds_since_ref + offset(_time_zone, self));
|
||||
s = fabs(s);
|
||||
s -= floor(s);
|
||||
v = (int)(s * 1000);
|
||||
v = (int)(s * 1000.0);
|
||||
}
|
||||
Grow(info, 3);
|
||||
info->t[info->offset+2] = (v%10) + '0';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue