rounding negative number in Maple T.A.

Why gives Maple T.A. for the function

decimal(2,-0.625)

as an answer -0.62 instead of -0.63?

I could not find documentation on the decimal function. Where can I find it?

 

kind regards,

Harry Garst

decimal(n, x) Returns x

decimal(n, x)

Returns x expressed as a floating-point number rounded to n decimal places.  When decimal(0,expression) is used with an expression, the system automatically inserts commas to separate thousands.

From http://www.brownstone.net/support/edu/authoring/

Regards, Hans van Walen

Dear Harry, Maple T.A.'s

Dear Harry,

Maple T.A.'s built-in functions, including decimal(n, x), are documented in the its online help system.

On your specific question, decimal(2,-0.625) returns -0.62 while decimal(2, 0.625) returns 0.63. Similarly, decimal(1, -0.65) = -0.6 while decimal(1, 0.65) = 0.7. What is common to all these cases is that Maple T.A. rounded up whenever the number lay right in the middle.

Thank you,

Carl Hickman

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}