Question : Special Values in VBA

Does VBA support the concepts of Negative Infinity, Positive Infinity, NaN, and Epsilon for its floating point data types? If not, could you suggest a good way of emulating them?

Answer : Special Values in VBA

floating point / rounding
http://support.microsoft.com/kb/214118/en-us
http://support.microsoft.com/default.aspx?scid=kb;en-us;196652
http://support.microsoft.com/kb/78113

sorry, can't say i've ever needed to identify infinity or epsilon

You can convert data types Variant and use CDec() to convert everything to the Decimal data type, which can be exact to 28 decimal digits.
i think that is as close as you'll get to epsilon

here are the only relations to 'infinity' i can find
norminv
http://support.microsoft.com/kb/827358
NORMDIST
http://office.microsoft.com/en-us/excel/HP052091921033.aspx
ERFC
http://office.microsoft.com/en-us/excel/HP100623171033.aspx

:)
a reason infinity may not work,.. it is really hard to calculate,
and you can't put infinity in a cell because a cell can contain up to 32,767 characters. However, if a cell contains more than 1,024 characters, the following rules apply:

" Characters after approximately the 1,024th character do not appear in the cell; however, they appear in the formula bar when you edit or select the cell.  
" Although characters after approximately the 1,024th character do not appear, you can detect and manipulate them with worksheet functions (for example, the RIGHT and MID functions) and macro commands (for example the Characters property).  
" If you copy a cell that contains more than 1,024 characters, and then paste them in another cell, all of the characters are pasted into the new cell. However, characters after approximately the 1,024th character do not appear in the destination cell.  
" Characters in a cell after approximately the 1,024th character are not printed and may not appear in print preview.  

Random Solutions  
 
programming4us programming4us