CompuServe Thread

#nint()

6 messages in this thread
#20879From: Michael FiggFeb 27, 1992 6:18 PM
A (probably) real simple question. I can't find my AREXX manual and I'm trying to figure out the nint() function. I think my manual is on the living room floor, but so is every thing else. The 2.04 manual and the Abacus book say nothing (that I could find) on the subject. Does it just give the whole number of a number, chopping off the remainder? And what does the 'n' stand for? Natural int? Thanks, Mike
#20882From: Black Belt SystemsFeb 27, 1992 8:05 PM
Mike, never heard of that function, but, if you'd like a nice INT function, try this: you have a number, lets say it's a float or MAY be a float: parse var number intpart '.' fracpart the variable "intpart" will have the integer portion in it, and (if there WAS a fractional portion) "fracpart" will have the fractional part in it. If it's important to know about the fractional part, put this line in there too: if fracpart = '' then fracpart = '.0'; else fracpart = '.'||fracpart; :^) –Ben
#20898From: Matthew J. W. RatcliffFeb 27, 1992 11:53 PM
I was always partial to x%1, although the integer division may be slower than string parsing.
#20911From: Black Belt SystemsFeb 28, 1992 8:16 PM
In ARexx, it probably is. Because ARexx is a string language; everything is a string. I *suspect* that the string solution is faster. Maybe Bill Hawes will step in here and give us the scoop. :^) –Ben
#20929From: Bill HawesFeb 29, 1992 12:41 AM
I didn't see the original message, so I'm not sure what you're asking. There isn't a nint() function in REXX or ARexx, if that's the issue … -Bill
#20899From: John DraperFeb 28, 1992 1:29 AM
Michael, I'm not surprised you didn't find anything on nint() in the docs or the Abacus book. I've been using Arexx since it first arrived, and I'm pretty sure I've never seen it. Where did you see a reference to it? -larry