You are at the section Calendar History
To Use Integer Portions of the Answers
For computer programmers using PowerBasic, use the INT() function like this:
answer1 = INT(answer)
26 = INT(26.4)
-2 = INT(-1.1) (NOTE: The Integer function rounds down to the previous integer, since -1.1 is greater than -2, the answer is -2, not -1, since -1 is greater than -1.1.)
To Use Decimal Portions of the Answers
For computer programmers using PowerBasic, use the FRAC() function for floating-point numbers (not integers).
The numbers can be single, double, or extended precision variables. It can also be used for negative numbers.
Caution: It doesn't quite give you the correct answer if you use SINGLE precision. You must use DOUBLE precision
numbers to get the correct decimal answer (variable# instead of variable!)
answer1 = FRAC(answer)
FRAC(2.6) = .6
FRAC(-2.6) = -.6
For those who don't have a FRAC() function, here's how to get the decimal portion of the answer.
You lose the sign so you end up with a decimal part of the answer.
answer1 = ABS(answer) - INT(ABS(answer))
ABS(2.6) - INT(ABS(2.6)) = .6 (2.6 - 2)
ABS(-2.6) - INT(ABS(-2.6)) = .6 (2.6 - 2)
To get the positive offset of the decimal portion of the previous integer, use this formula:
answer1 = answer - INT(answer)
2.6 - INT(2.6) = .6 (2.6 - 2)
-2.6 - INT(-2.6) = .4 (-2.6 + 3)
© 1995-2020. davesfunstuff.com All Rights Reserved. Reproduction of any part of this website without expressed written consent is prohibited.
Notice Of Disclosure (updated Oct 2019):
"David Tanny, owner and operator of the domains davesfunstuff.com, dfsxradio.com, megabirthdays.com, eightisenough.com, dementeddatebook.com, sandiegoradionews.com and davidtanny.com, and its related subdomains, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. By making a purchase through the links to an amazon product or group page, this webmaster earns a small commission to pay for website administration duties. Linking does not imply endorsement. Clicking does not cost the visitor money. Please read the reviews of the product and return policies before deciding on making a purchase from a seller on Amazon. You will not be required to buy what you don't want or need. Thank you readers."