Re: integer division
- Posted by Robert Craig <rds at CLASSIC.MSN.COM> Sep 05, 1997
- 696 views
Andrew Nagy asked: > Does Euphoria have a version of the Qbasic "\" operator? To perform integer division in Euphoria use something like: z = floor(x/y) This will give you a result that is rounded down to an integer. I don't know if it's exactly compatible with QBasic for negative numbers. It looks like it would be slower than a normal divide, but actually floor(x/y) is faster than x/y. > Also, one thing > that I've never found in any language, even Euphoria, is a way to create a > user-defined operator. You can do it in C++, but I think it leads to unreadable code. e.g. you might extend the meaning of the "+" or "-" symbols. Regards, Rob Craig Rapid Deployment Software