12.07.2015 Views

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

ILOG OPL Development Studio Language Reference Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Special numbersThere are three special numbers: NaN (Not-A-Number), Infinity (positive infinity), and-Infinity (negative infinity).The special number NaN is used to indicate errors in number manipulations. For example,the square root function Math.sqrt applied to a negative number returns NaN. There is norepresentation of NaN as a number literal, but the global script variable NaN contains its value.The NaN value is contagious, and a numeric operation involving NaN always returns NaN.A comparison operation involving NaN always returns false —even the NaN == NaNcomparison.Examples of NaN:Math.sqrt(-1) NaNMath.sqrt(NaN) NaNNaN + 3 NaNNaN == NaN falseNaN = 3 falseThe special numbers Infinity and -Infinity are used to indicate infinite values and overflowsin arithmetic operations. The global script variable Infinity contains the positive infinity.The negative infinity can be computed using the negation operator (-Infinity.)Examples of Infinity:1/0 Infinity-1/0 -Infinity1/Infinity 0Infinity == InfinitytrueI L O G O P L D E V E L O P M E N T S T U D I O L A N G U A G ER E F E R E N C E M A N U A L213

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

Saved successfully!

Ooh no, something went wrong!