public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/97689] New: (ceilf(begin/(float)tstep))*tstep
@ 2020-11-03 9:28 jkaltes at hotmail dot nl
2020-11-03 9:29 ` [Bug c/97689] (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
2020-11-03 9:44 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: jkaltes at hotmail dot nl @ 2020-11-03 9:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97689
Bug ID: 97689
Summary: (ceilf(begin/(float)tstep))*tstep
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: jkaltes at hotmail dot nl
Target Milestone: ---
Created attachment 49490
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49490&action=edit
.i file
#include <stdio.h>
#include <math.h>
int main() {
unsigned int begin=1604288179,tstep=3600;
unsigned int first=(ceilf(begin/(float)tstep))*tstep;
unsigned int first2=((unsigned int)ceilf(begin/(float)tstep))*tstep;
printf("%d %d\n",first,first2);
}
./a.out
gives:
1604289536 1604289600
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/97689] (ceilf(begin/(float)tstep))*tstep
2020-11-03 9:28 [Bug c/97689] New: (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
@ 2020-11-03 9:29 ` jkaltes at hotmail dot nl
2020-11-03 9:44 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: jkaltes at hotmail dot nl @ 2020-11-03 9:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97689
--- Comment #1 from Jaap Korthals Altes <jkaltes at hotmail dot nl> ---
Created attachment 49491
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49491&action=edit
gcc -v
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/97689] (ceilf(begin/(float)tstep))*tstep
2020-11-03 9:28 [Bug c/97689] New: (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
2020-11-03 9:29 ` [Bug c/97689] (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
@ 2020-11-03 9:44 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-03 9:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97689
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
What do you expect? 445636*3600 isn't exact representable in float but it is
in unsigned int.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-03 9:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 9:28 [Bug c/97689] New: (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
2020-11-03 9:29 ` [Bug c/97689] (ceilf(begin/(float)tstep))*tstep jkaltes at hotmail dot nl
2020-11-03 9:44 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).