11.07.2015 Views

Advanced Programming Guide

Advanced Programming Guide

Advanced Programming Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

348 • Appendix A: Internal Representation and ManipulationThis represents the Maple error statement. The expr is either a singleexpression (if only a message was specified in the error statement), or anexpression sequence (if arguments were also specified). The actual internaltag used for the ERROR structure is MERROR, to prevent collision with amacro defined by some C compilers.Expression SequenceMaple syntax: expr, expr, . . .Length: 1 or moreEXPSEQ ∧ expr ∧ expr . . .Expression sequences are available to the user as a data structure, andare also used to pass arguments to procedures. Effectively, procedures takea single argument that is an expression sequence. An expression sequencemay be of length 1 (that is, an empty sequence), which is representedby the Maple symbol NULL, or in some contexts (such as parameters to afunction call) as nothing at all.Floating-Point NumberFLOAT ∧ integer1 ∧ integer2 ∧ attrib − exprMaple syntax: 1.2, 1.2e3, Float(12,34), Float(infinity)Length: 2 (or 3 with attributes)A floating-point number is interpreted as integer1 ∗ 10 integer2 . Afloating-point number may optionally have attributes, in which case thelength of the structure is 3, and the third word points to a Maple expression.This suggests that several floating-point numbers with the samevalue but different attributes can exist simultaneously.The integer2 field can optionally be one of the names undefinedor infinity, in which case the FLOAT structure represents an undefinedfloating-point value (not-a-number, or NaN, in IEEE terminology), or afloating-point infinity. When integer2 is undefined, integer1 can takeon different small integer values, allowing the existence of different NaNs.When integer2 is infinity, integer1 must be 1 or −1.For/While Loop StatementFOR ∧ name ∧ from− ∧ by− ∧ to− ∧ cond− ∧ stat−expr expr expr expr seq

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!