Code::Blocks Forums
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
As usual while waiting for the next release - don't forget to check the
nightly builds
in the forum.
Home
Help
Search
Login
Register
Code::Blocks Forums
»
User forums
»
Using Code::Blocks
»
rouinding up / down from a floating point number to an interger form
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: rouinding up / down from a floating point number to an interger form (Read 3883 times)
David Marsh
Guest
rouinding up / down from a floating point number to an interger form
«
on:
August 16, 2020, 05:56:32 am »
I have floating point calculations running which often end up in FP format but I wish to store them as INT`s for future use.
so far been unable to find any reference to this in my code books! So I need some help thanks in advance, David.
Logged
raynebc
Almost regular
Posts: 223
Re: rouinding up / down from a floating point number to an interger form
«
Reply #1 on:
August 18, 2020, 03:02:25 am »
Any decent programming book (at least for C style languages) should describe casting from one data type to another. That's where you should start.
Logged
stahta01
Lives here!
Posts: 7786
Re: rouinding up / down from a floating point number to an interger form
«
Reply #2 on:
August 18, 2020, 04:02:34 am »
Please follow this link
http://www.cplusplus.com/reference/cmath/round/
After that read and at least try to follow the rules for this website
http://forums.codeblocks.org/index.php/topic,9996.0.html
Tim S.
Logged
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ.
http://wiki.codeblocks.org
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
Code::Blocks Forums
»
User forums
»
Using Code::Blocks
»
rouinding up / down from a floating point number to an interger form