如何在目标C中表示无穷大?

时间:2015-05-30 09:13:00

标签: objective-c infinity

有没有办法在目标C中表示无穷大(如浮点数/双数,或NSN数等)?换句话说,是否有一个float / double / NSNumber值总是大于目标C中的任何其他值?

1 个答案:

答案 0 :(得分:8)

这是$rnum = 1; $receipt = R::findOne('receipts', '1 ORDER BY rnum DESC'); if (isset($rcprec->id)) { $rnum = $receipt->rnum + 1; } $rcptmain = R::dispense( 'receipts' ); $rcptmain->rdate = $dor; $rcptmain->srdate = $sdor; $rcptmain->studid = $sid; $rcptmain->course = $course; $rcptmain->part = $part; $rcptmain->otherfees = $otherfees; $rcptmain->rnum = $rnum; $id = R::store( $rcptmain );

的宏
INFINITY

您可以在usr / include / math.h

中找到
float x = INFINITY;

编辑这里有一些更有趣的内容

http://www.gnu.org/software/libc/manual/html_node/Infinity-and-NaN.html