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.

DarkBASIC Professional Discussion / Confusing maths :-S

Author
Message
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 1st Jun 2003 03:39 Edited at: 1st Jun 2003 03:41
Ok so I feel really stupid as I've been using DarkBasic for years and not noticed this. BUT

print 5/2

Surely this should give a result of 2.5? But instead, in both pro and classic I get 2 Its not even rounding it to the nearest whole number cos that would be 3 Very confusing

What's going wrong here and how do I make a simple sum like this give the correct answer? Always just kinda presumed basic stuff like this worked

Or is it my pc, and every1 else's returns a 2.5 ?

Any help appreciated, thanks!

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2003 03:54
Getting late, head hurts (too much drink). Alien 4 just finished. Want to sleep.

This topic been discussed way too much, even you have participated in previous threas about this very 'problem'.

If all values on right hand side are integers, then answer is integer (rounded DOWN).

print 5.0/2 gives proper answer of 2.5

Gronda, Gronda
MrTAToad
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2003 03:55 Edited at: 1st Jun 2003 03:56
Sonic, see if you can find a Alien reference in one of my replies (I just had too)...

Is this another Kangaroo2 or the original one ? I suspect the former as its rather a silly question...

Good news everyone! I really am THAT good...
http://www.nickk.nildram.co.uk/ for great plug-ins - oh my, yes!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 1st Jun 2003 04:01
oh yes very funny MrTAToad. You and your 'bug' references!

http://www.darkbasicpro.com/apollo/view.php?t=2817&b=1

Above link goes into more detail about integer 'problem'

Gronda, Gronda
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 1st Jun 2003 04:05
lmao No I'm afraid its me, I'm just having a very busy and tiring day

Yup I remember now And yes you're right I have talked about this before and helped others with the very problem! D'Oh!

Sorry for wasting your time - wish I could blame it on drink, but I can't. It'll just have to be the late nights then

I would have remembered by 2morro but it would have been too late - THANKS this makes my job 2nite a whole load easier

Bunnies aren't just cute like everybody supposes, They got them hoppy legs & twitchy little noses,
And what's with all the carrots? What do they need such good eyesight for anyway?

Login to post a reply

Server time is: 2026-07-11 11:42:22
Your offset time is: 2026-07-11 11:42:22