Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / quick datatype question (using reals)

Author
Message
Flip5577
19
Years of Service
User Offline
Joined: 3rd Nov 2004
Location:
Posted: 2nd Jan 2006 09:12
I'm following a tutorial in a book and I'm having trouble with this code.

you see I give the variables specific values, but when I compile, the value is printed as 43.340003889 or something like that.

I dont understand why the value was raised, (even if it was ever so slightly). What is wrong with the following code?

Larry Charles, Jr.
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Jan 2006 07:16
That's the way Darkbasic is... I don't like it either but it's just something we have to put up with. There's a rounding function I made as an example in the link. It turns the floats into strings though (converting the string to a float just brings back the problem).

http://forum.thegamecreators.com/?m=forum_view&t=68022&b=15


Login to post a reply

Server time is: 2024-09-24 13:31:13
Your offset time is: 2024-09-24 13:31:13