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 / simple math...

Author
Message
Krash
16
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 14th Oct 2002 01:39
I've used BASIC programming for a number of years in the form of C64 basic, Qbasic, and VB 6.0. I am currently using the demo version of DBP and have a question...
Why doesn't this work...

a# = 50/70
print a#

I should get .7142, but instead I get 0. Anyone know why?
This language has quite a few quirks over other basics
and this is the only reason I havn't purchased it yet...
It's great for 3D stuff, but it's hard for me to adapt.
QuothTheRaven
16
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 14th Oct 2002 02:06
Doesn't work for me either...it seems like dark basic can't handle repeating decimals.
QuothTheRaven
16
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 14th Oct 2002 02:07
yaaaaa it rounds with decimals inputed as fractions, if you input the decimal it'll store it as that but it cuts the fractions off to the nearest whole number.
Krash
16
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 14th Oct 2002 02:15
Well that sucks... My actual code uses variables such as

A# = 70
B# = 50

C# = ASIN(B#/A#)

the asin() function needs a decimal number and my program will not work without it... If the little things don't work then is it really worth it?

QuothTheRaven
16
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 14th Oct 2002 05:34
i'm sure theres a way to change the float value in db.
Marc Fleury
16
Years of Service
User Offline
Joined: 1st Oct 2002
Location:
Posted: 14th Oct 2002 07:08
It's a bug.

Write:

a# = 50.0/70.0

and it will work.

Learn DB here -- http://www.dbheaven.com/ -- Learn DB here
Milamber
16
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 14th Oct 2002 11:28
Over the next 6 months, all the major bugs should be well and truly eliminated. Just wait and watch.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
Krash
16
Years of Service
User Offline
Joined: 13th Oct 2002
Location:
Posted: 14th Oct 2002 19:30
Thanks Marc.

It's all fun and games 'till someone loses an arm...
MrTAToad
16
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 14th Oct 2002 23:21
I certainly hope so.

Yes, I really am THAT good...

Login to post a reply

Server time is: 2019-07-20 13:58:58
Your offset time is: 2019-07-20 13:58:58