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 / Read/Write Float

Author
Message
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 7th Jun 2003 05:22 Edited at: 7th Jun 2003 05:50
I have 2 questions on floats:
1 What is a float?
2 What is it used for?
I have seen it lately in posts, used help in DBC, but I don't know they can be used for.
Can anyone answer any question (especially #2)
please help me!
Mattman

Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
---Andy Rooney
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Jun 2003 06:20 Edited at: 7th Jun 2003 06:22
1. A float is a number with a floating decimal point, for example, 3.14159265358 (an approximation of pi, from my head). Floats can be 34E +/-38. To use a float variable you can do:



or



Floats can only have 7 digits and whole numbers are more important, so it will cut the decimal off. In the example above, pi,only 3.141592 would be displayed. Example:



a# will print as 1234.567, but b# will print as 123456.7 (the 8 got cut off)

2. Floats are used instead of whole numbers, or integers, to do more presise calculations, fractions, 3D coordinates, and more.

"Food is güd!" -Dean
"All programmers are playwrites and all computers are lousy actors" -Anon
Click Here!!!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 7th Jun 2003 06:24
thx andrew11!
---mattman---

Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
---Andy Rooney
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 7th Jun 2003 06:25
no prob

"Food is güd!" -Dean
"All programmers are playwrites and all computers are lousy actors" -Anon
Click Here!!!
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 7th Jun 2003 06:28 Edited at: 7th Jun 2003 06:30
Hey andrew:
can u check out my error prob here:

http://www.darkbasicpro.com/apollo/view.php?t=11360&b=10

remember it is in DBC, not DBPro if that is what u use!
plz help!

Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
---Andy Rooney

Login to post a reply

Server time is: 2024-09-20 10:23:57
Your offset time is: 2024-09-20 10:23:57