[futurebasic] Re: [FB] House Management and C code (FB^3)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2001 : Group Archive : Group : All Groups

From: AlStaff@...
Date: Thu, 25 Jan 2001 20:11:06 EST
>So Floor (5.4) would give 5, Ceiling (5.4) would give 6, I reckon.
>
>
>FIX can handle any Floor situation, but INT can return 5 for 5.4 or 6 for
>5.6, how might I make it or similar round up regardless?
>
>If I have this wrong, C interpretation -wise, clarification is welcome.
>
>Is there any "HiINT" keyword somebody can add to the runtime/compiler subs
>to make this happen easier, and still keep the normal INT rounding up or
>down like I like normally?

is this what you want?

local fn ceiling(myNumber#)
myInt = FIX(myNumber#)
if myInt < myNumber# then myNumber# = myInt + 1
end fn = myNumber#

window 1
for X# = 0 to 11
myNumber# = 5 + (X#/10)
print myNumber#;
myNumber# = fn ceiling(myNumber#)
print " --> Ceiling = ";myNumber#
print
next X#

while 1
handleevents
wend


Al Staffieri Jr.

AlStaff@...
http://members.aol.com/AlStaff/index.html